NVM is Node Version Manager is a tool to manage multiple node.js version.

list installed version

❯ nvm ls

        v8.17.0
->      v12.9.0
        system
default -> 12.9 (-> v12.9.0)
node -> stable (-> v12.9.0) (default)
stable -> 12.9 (-> v12.9.0) (default)

list available version on remote (is version 14 available? If so it will list)

❯ nvm ls-remote 14
    v14.0.0
    v14.1.0
    ...
   v14.13.1
   v14.14.0

Install the version that you would like

❯ nvm install 14

Set version 14 (or another version) as default

nvm alias default 14

Switch to version 8 (or another version)

❯ nvm use v8
Now using node v8.17.0 (npm v6.14.8)

Cheers!

fzf is a general-purpose command-line fuzzy finder. Let’s install and make you 10 times more productive!

install fzf

# clone into ~/.fzf
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
# run install command
~/.fzf/install

output: answer “y” to enable auto-completion and key bindings

Cloning into '/home/naoko/.fzf'...
remote: Enumerating objects: 101, done.
remote: Counting objects: 100% (101/101), done.
remote: Compressing objects: 100% (94/94), done.
remote: Total 101 (delta 4), reused 28 (delta 2), pack-reused 0
Receiving objects: 100% (101/101), 180.78 KiB | 1.83 MiB/s, done.
Resolving deltas: 100% (4/4), done.
Downloading bin/fzf ...
  - Found in $PATH
  - Creating symlink: bin/fzf -> /usr/bin/fzf
  - Checking fzf executable ... 0.20.0 != 0.21.1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   637  100   637    0     0   1750      0 --:--:-- --:--:-- --:--:--  1750
100 1127k  100 1127k    0     0   991k      0  0:00:01  0:00:01 --:--:-- 2597k
  - Checking fzf executable ... 0.21.1
Do you want to enable fuzzy auto-completion? ([y]/n) y
Do you want to enable key bindings? ([y]/n) y

Generate /home/naoko/.fzf.bash ... OK
Generate /home/naoko/.fzf.zsh ... OK

Do you want to update your shell configuration files? ([y]/n) y

Update /home/naoko/.bashrc:
  - [ -f ~/.fzf.bash ] && source ~/.fzf.bash
    + Added

Update /home/naoko/.zshrc:
  - [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
    + Added

Finished. Restart your shell or reload config file.
   source ~/.bashrc  # bash
   source ~/.zshrc   # zsh

Use uninstall script to remove fzf.

For more information, see: https://github.com/junegunn/fzf

Let’s play

Key Binidngs

  • ctl + r: fuzzy find thorugh your command history
  • ctl + t: fuzzy find through the current directory

** trigger command + tab

It understand context and list only relative stuff. eg:

  • cd ** + tab
  • ssh ** + tab

Cheers!

I’ve been using JSONLint for every JSON prettifier needs. This site is super because it even format invalid JSON. For example, standard JSON prettifier won’t prettify JSON with key or value enclosed in single quote but this site does but having your local editor do quick prettifier if you have valid JSON or willing to quickly fix with find and replace.

Sublime is my go to text editor - taking note, prettify JSON etc. So let’s do that real quick.

Install Pretty JSON package. Assuming you are using Linux. If you are using other OS, key combination is different.

CTL + SHIFT + P > type “Install package” > Select Install package > Search for Pretty JSON > select it (this will install the package)

Okay now the package is installed, copy and paste into this UGLY JSON

[{"fav_fruit": "banana","fav_color":"red?","age":29}]

then hit CTL + ALT + J it will re-format to

[
  {
    "fav_fruit": "banana",
    "fav_color": "red?",
    "age": 29
  }
]

Whoohoo!

Cheers!

I tested out Stanza. English tokenizer and definately works. I ran quick test with Japanese lang and output was somewhat unexpected.

import stanza

# japanese "ja", for english model "en"

stanza.download("ja")
nlp = stanza.Pipeline("ja")
doc = nlp("皆さんおはようございます! ご機嫌いかがですか?")

for i, sentence in enumerate(doc.sentences):
    print(f"===== Sentence {i+1} tokens =====")
    print(*[f"word: {word.text}\t upos: {word.upos} xpos: {word.xpos}" for word in  sentence.words], sep="\n")

The output is:

===== Sentence 1 tokens =====
word: 皆さん	 upos: PRON xpos: NP
word: おは	 upos: VERB xpos: VV
word: よう	 upos: AUX xpos: AV
word: ござい	 upos: VERB xpos: VV
word: ます	 upos: AUX xpos: AV
word: !	 upos: PUNCT xpos: SYM
===== Sentence 2 tokens =====
word: ご	 upos: NOUN xpos: XP
word: 機	 upos: NOUN xpos: XS
word: 嫌い	 upos: NOUN xpos: NN
word: か	 upos: PART xpos: PF
word: が	 upos: ADP xpos: PS
word: です	 upos: AUX xpos: AV
word: か	 upos: PART xpos: PE
word: ?	 upos: PUNCT xpos: SYM

I’m not qualified to evaluate accuracy of POS etc but at least as far as tokenization goes, I would expect

["皆さん", "おはよう", "ござい", "ます", "!"]

and

["ご", "機嫌", "いかが", "です", "か". "?"]

Cheers!

See Useful keyboard shortcuts

Addition to the above:

  • Super + Space: Change input keyboard

  • Ctl + Q: Close an application window

  • Super + ↑ : Maxmize the application window.
  • Super → or ← : Move the application window to left right

```

Cheers!