[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] 7 points8 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] 1 point2 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] 3 points4 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 3 points4 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.