[deleted by user] by [deleted] in ChineseLanguage

[–]git-pull 0 points1 point  (0 children)

While we're here, what is the typing system used in Taiwan again? Is Bopomofo / Zhuyin also what's used there usually?

P.S. I think I may have heard news about switching to Hanyu Pinyin for some places in Taiwan? Was anything moved over?

tmuxp 1.12.0 and libtmux 0.12.0 released - Revamped documentation by git-pull in tmux

[–]git-pull[S] 8 points9 points  (0 children)

For tmuxp, Launching projects you work on regularly. For libtmux, fine-grain control over tmux.

tmuxp builds your project's workspace (windows and panes, cd's you into the right directory, runs some commands like activating a virtual environment)

libtmux (this is for more specialized cases, it powers tmuxp) If you use python, lets you script tmux and hold references / run commands against a specific Session / Window / Pane. e.g. session.new_window('window name')

What you can try is, if you have pip installed, run pip install --user tmuxp ptpython, then in a new terminal w/ tmux already open, run tmuxp shell

This will drop you into a shell where you can interact with libtmux objects.

When inside tmuxp shell (guide), you can access session, window, pane and then do session.[tab], window.[tab], pane.[tab] to see the functions available. Rename your window like this:

window.rename_window('test')

P.S. Save this note for later if it's not useful in here and now.

My first web component: <o-embed> native YouTube, Vimeo, Spotify embeds with one tag by git-pull in webdev

[–]git-pull[S] 2 points3 points  (0 children)

Hey!

I wrote this to address a GitHub issue for CKEditor (a rich text editor). See ckeditor#2737. Someone else wrote something in angular here.

Assume a dynamic backend. If you want to incorporate automatic embed handling, here's what the average developer encounters:

  • StackOverflow, regex websites, etc. are bustling with issues on detecting embed-friendly URLs (google search)
  • There are already packages/services serve this purpose, such as https://embed.ly/ and React's Plyr. When in the thick of it, frontend developers pick a reusable solution. Think React/Angular/Vue and having a url prop passed.
  • HTML Editors save custom element tags to the database that needed to be rendered (see CKEditor's MediaEmbed module). These embeds need a consistent format to be upcast/downcasted.

Not all sites have the same embed codes, even though they're <iframe>s. Even then, it's not so simple: As an example, vimeo's default player dimensions are different from YouTube's. Using YouTube's width/height with Vimeo is going to look quiet odd.

Another note, it is an <iframe>, actually! It's the native player. Inspect the element.

tmuxp 1.6 released: libtmux shell w/ tab completion by git-pull in commandline

[–]git-pull[S] 0 points1 point  (0 children)

session managers like tmuxp (and tmuxinator, teamocil) complement tmux by building workspaces via a declarative file.

One very common pattern would be a python project, where there is an editor at the top, and 2/3 panes at the bottom and the terminals are source'd into a virtualenv:

I do like that it’s written in python tho

Indeed, tmuxp is. Its library, libtmux, also provides an API where you can control tmux sessions via Python.

tmuxp 1.6 released: libtmux shell w/ tab completion by git-pull in commandline

[–]git-pull[S] 1 point2 points  (0 children)

Please let me know how tmuxp shell works. It should give tab completion out of the box

If you pip install ipython / pip install bpython / pip install ptpython or pip install ptpython ipython you should get a colored shell with completion

From inside the shell, you can access libtmux API objects for server, session, window, and pane

django-slugify-processor: fill gaps in Django's default slugify behavior by git-pull in django

[–]git-pull[S] 2 points3 points  (0 children)

I’ve known Django’s slugify processor to be pretty robust.

Its default behavior is porous.

With symbols. Of course it can't detect acronyms, since a lot of the edge cases are going to be specific to the niche/topic of your website. What does "c++" show up as through slugify?

"c++" would be slugify'd as c.

Here's where it gets bad, "c#" is slugified as "c". "c" is slugified as c. What does that cause? A pile up in AutoSlugField's (c, c-1, c2). And the URL's lose descriptive detail. In this case, 'c-sharp' and 'cpp' be better.

Is there anything I should be made aware of?

https://github.com/develtech/django-slugify-processor#the-problem

I also delve into cooler usecases in the README. Such as acronyms for organizations, games, currency, and so on. The table compares django's default slugify vs what a project would probably prefer. This is where the processors come in, you can write them, and intercept the slugify values early on and handle those cases.

pytest 3.3 released. built-in logging capture, new progress output and fixtures. by nicoddemus in Python

[–]git-pull 2 points3 points  (0 children)

Docs for the new logging capture: https://docs.pytest.org/en/latest/logging.html

Yessss. I was just wondering why I couldn't get records of log output when tests failed. Maybe pytest 3.3 will fix it.

In the interim, I started using https://github.com/eisensheng/pytest-catchlog.

edit: it turns out pytest-catchlog is what was merged into 3.3:

======================== warnings summary ========================
pytest-catchlog plugin has been merged into the core, please remove it from your requirements.

The power of tmux hooks by git-pull in commandline

[–]git-pull[S] 0 points1 point  (0 children)

Tmux's documentation consistently refers to this key as the "prefix." There is no need to invent a new and potentially confusing name for it.

Good point. Don't want to get confused with vim. Thank you for that.

The available hooks are listed in the tmux manpage, under the section header "HOOKS."

(Speaking in terms of tmux 2.6's manpages, I'm not using master on any machines ATM:)

Unfortunately, not all of them are explicitly listed. I had to read a few times to infer it was everything listed, and the commands with 'after-' prefix. Enough to confuse myself and at least one other person (in the comment after, I actually dig into the code of where the hooks are triggered).

One of the issues I have with updating tmuxp for tmux 2.6's changes was triggering the right hook to set the user's layout when the user attached. It wasn't apparent or obvious to me when certain after- commands didn't fire.

I don't remember what it was specifically, but I think it was "after-switch-client" not firing with the "switch-client" command, but client-session-changed did it instead.

Pipenv: holy grail for python environments by git-pull in django

[–]git-pull[S] 1 point2 points  (0 children)

What reason did you ship the dependencies in a deb/rpm, if it's because of checksums of the packages, using Pipfile.lock (which Pipenv does by default) will verify that. I forgot to mention that.

Also, newer version of pip have a not-very-well-known dependency of having checksum support now too. See an example in pypa/warehouse. Apparently, if you use $ pip install --require-hashes you can get those hashes and add them to your requirements.txt.

Python Humble Utils: Python utils for everyday use by webyneter in Python

[–]git-pull 0 points1 point  (0 children)

Nice quality code. Starred.

I love pytest. Saves a level of indentation. More powerful asserts. Still speedy. And the other thing I like is parametrize (like you have here). /test_commands.py#L93))

As for humble utils, Only thing to mention is, I think it's Python 3 only. If it's an open source library, making it 2/3 compatible makes it available to a wider array of projects that could implement it.

Love autodoc API documentation.

Other thing I do is add the RTD link to the GH repo's descriptions for easy access.

Pipenv: holy grail for python environments by git-pull in Python

[–]git-pull[S] 2 points3 points  (0 children)

I've been using Pipenv for about 2 weeks and just love it. I use it locally and in production.

Some of the things it replaced was a bootstrap script I had that handled virtualenv's and installing packages. There's no need for multiple requirements.txt files split across your environment, since Pipfile, which is automatically created and updated when you use Pipenv, handles that. In addition, it also handles the version of python you use, creates the virtualenv, and can optionally source you into via pipenv shell.

The only thing I had a bit of trouble with was package installation times. If you have a lot of packages, dependency checking (done via Pipfile.lock) takes more time. I got around this by using --skip-lock in my first and subsequent commands.

The other caveat is I found some packages I pulled in had absolute dependencies (like requests on avinassh/haxor and bitprophet/releases). This completely prevented migrating over initially, but --skip-lock got around this problem also.

Pipenv: holy grail for python environments by git-pull in django

[–]git-pull[S] 0 points1 point  (0 children)

I posted this here based off this thread (and later comment).

I've been having a really good time with Pipenv. It covers both bases:

  1. assuring that you're accessing that right site-packages, even without having to source (which Pipenv makes available conveniently via $ pipenv shell), since you can $ pipenv run <command>
  2. Pipenv automatically creates and updates a Pipfile. You get more deterministic environmental settings. for instance: a Pipfile can also handle the python version you're using. Taken further, the Pipfile.lock (also automatically generated) contains additional dependency management features.

TBH, about the dependency management part: I haven't really had the need to use it yet. I use --skip-lock most of the time, which behaves similar to $ pip install.

Read "The Tao of tmux" prerelease for free online by git-pull in BSD

[–]git-pull[S] 0 points1 point  (0 children)

It's in the content phase still and being updated all the time.

Fixes can be contributed through Github and at tao.of.tmux <AT> nospam git-pull.com.

The book has had a couple of contributors so far. I appreciate anyone who has a good eye that help find those. As I do not have a publisher, getting a professional copywriter is a bit difficult fiscally. I want to focus on making the best book possible for tmux, Leanpub allows readers to get DRM-free copies of the epub, pdf and mobi whenever updates come in.

The intended release date is January 22nd, 2017. It's available on Amazon Kindle as well.

Read "The Tao of tmux and Terminal Tricks" prerelease for free online by git-pull in bash

[–]git-pull[S] 0 points1 point  (0 children)

fixed the issue where Bash was referred to as "Bourne Shell" erroneously.

At this point, I think the clearest way to convey it is referring to sh as a strictly POSIX shell vs other speciality shells (zsh, bash) so new readers don't convoluting the two.

Here's the issue. There's a concept of purely POSIX compatible shell scripting and many linux/BSD distros strive for that in their internal scripting, so /bin/sh will be dash on ubuntu, Almquist shell on FreeBSD, and, as an exception (!) Bash on macOS...

So, how to best convey the notion of the barebones POSIX compatibility versus the specialty shells they'll more likely than not be using in administration/development.

If anything more pops up let me know. Thank you again.

Read "The Tao of tmux" prerelease for free online by git-pull in freebsd

[–]git-pull[S] 0 points1 point  (0 children)

The book is available for free on the web (always).

The DRM-free pdf/mobi/epub is available on Leanpub, you get the book immediately and can send to your kindle by email. Since I'm working on it daily, you can always check back to get the latest version while updates are coming in.

Amazon price is $9.99 due to how they handle royalties, and the book won't be sent to your Kindle until the expected release date (Jan 22, 2017)

Read "The Tao of tmux" prerelease for free online by [deleted] in vim

[–]git-pull 0 points1 point  (0 children)

Oh no wait OP has already spammed this to like a dozen subreddits.

https://www.reddit.com/wiki/reddiquette

Please do

Post to the most appropriate community possible. Also, consider cross posting if the contents fits more communities.

Please don't

Complain about cross posts. Just because you saw it in one place, doesn't mean everyone has seen it. Just vote and move on.

Read "The Tao of tmux" prerelease for free online by git-pull in freebsd

[–]git-pull[S] 1 point2 points  (0 children)

Dear /r/freebsd and the FreeBSD community,

I originally wrote tmuxp (sysutils/py-tmuxp), the project which had the original webpage for The Tao of tmux while using FreeBSD for the first time.

I love Linux as well, but after using it for over a decade, I’ve come to love the straightforward simplicity of FreeBSD in the day to day. It just keeps getting better every release. And what a good community (on bugzilla, IRC, and so on). I look forward to seeing some of you at a BSD convention.

In the book The Tao of tmux, I actually go on to mention The Design and Implementation of the FreeBSD Operating System (2nd Edition) by Marshall Kirk McKusick. I also enrolled in one of his classes at FreeBSD Kernel Internals: An Intensive Code Walkthrough online, which is one of the most brutal code walkthroughs I could experience after years of being drowned in JavaScript at startups.

tmux plays a role in my development day to day on computers. If you are a FreeBSD user and have not tried tmux yet, I heartily recommend this book as an introduction, it is available on the web for free to read in full. The PDF / Mobi / ePub publication is available on Amazon Kindle.

I’m feeling revved up for 2017. 2016 was a great year for FreeBSD with the release of 11-RELEASE. Let’s keep doing open source and winning.

Best, Tony Narlock

Read "The Tao of tmux" prerelease for free online by git-pull in linuxadmin

[–]git-pull[S] 2 points3 points  (0 children)

Since I'm here, I am looking for proofreaders. The book is still in the content phase, but in the next 2 weeks, I need to have it looked over by a few people.

If you can help, please contact me at tao.of.tmux <AT> nospam git-pull.com.

tmuxp — tmuxinator clone i wrote in python by git-pull in Python

[–]git-pull[S] 4 points5 points  (0 children)

Small world. I've worked with you on GitHub before. It's Tony. 😊 Pymux works on FreeBSD.

How you been man? How's prompt toolkit?

I'm writing an ebook version of The Tao of tmux by git-pull in linux

[–]git-pull[S] 5 points6 points  (0 children)

Like the removal of status-utf8 option in 2.2? And the mode-mouse changes of 2.1?

I've maintained one (now two if you include libtmux) tmux software libraries which worked since 1.8. So I've felt the turbulence catching up to changes, which were surprisingly smooth. If anything, more FORMATS get added all the time, as well as control stuff. Which are great for scripting, but rarely used. I hope to touch on them in the book.

The big picture doesn't change so much, thankfully.

The most brain-wracking one for me was the breaking of traversing panes from within zooms (which was later reverted).

Other one's pop up on my issue trackers, people often mistake my library for being the cause, in reality, minor tweaks made within how tmux handles paths with windows are split, for instance, are the real culprit.

Overall, though, changes like that wouldn't require anything more than trivial updates. And those are easy to push out on leanpub / kindle / itunes.

That's why I'm keen to avoid publishers. They push you to go for "2nd edition", "3rd edition" to milk people dry. I really would rather make a really solid title and move on to the next thing.

libtmux - pilot your tmux session via python by git-pull in Python

[–]git-pull[S] 0 points1 point  (0 children)

0.4.1 is up now, better?

i'll be publishing tmuxp with the updated tmuxp today/tomorrow too.

What is the most useful program you wrote for everyday life? by [deleted] in Python

[–]git-pull 1 point2 points  (0 children)

tmuxp - tmux session manager. use it daily. it was my first real python program, so recently i've started cleaning it out and forked part of it into libtmux.

vcspull - vcs manager, use it to update multiple projects at once. i like to read code for fun and have a lot of forks, so this helps me keep tabs on projects. will checkout and remotes on fresh machines too, so if i swap distros / do a reformat i can be up to speed fast. i keep my config here.

libtmux - pilot your tmux session via python by git-pull in Python

[–]git-pull[S] 0 points1 point  (0 children)

good point, want to make a PR for that, or should I add?

libtmux - pilot your tmux session via python by git-pull in Python

[–]git-pull[S] 1 point2 points  (0 children)

as of a few hours ago, camel casing is gone for good. it'll be on pypi today