Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.
- Install iTerm2 from https://www.iterm2.com/
- Install oh-my-zsh from https://ohmyz.sh/ or https://github.com/robbyrussell/oh-my-zsh
- Set iTerm2 theme tab theme to Dark -
Preferences | Appearance | Tabs | Theme > Dark - Install Fira Code fonts from https://github.com/tonsky/FiraCode (Clone and navigate to
dstr > ttf, install all font files by double clicking) - Install Powerline fonts from https://github.com/powerline/fonts
- Set fonts for iTerm2 -
Preferences | Profiles | Text- Change
Fontto14pt Fira code regularand CheckUse Ligaturescheckbox - Change
Non ASCII Fontto14pt Fira monoand CheckUse Ligaturescheckbox
- Change
- Install iTerm2 snazzy theme from https://github.com/sindresorhus/iterm2-snazzy
- Navigate to
Preferences | Profiles | Color Presets > Snazzy
- Navigate to
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Install prerequisites | |
| yum install -y gcc openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel ruby-devel gcc-c++ jq git | |
| # Import key | |
| curl -sSL https://rvm.io/mpapis.asc | gpg2 --import - | |
| # Install RVM | |
| curl -sSL https://get.rvm.io | bash -s stable --ruby |
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # This line sorts first according to numerical size in bytes | |
| # the second pass through du in the while loop converts to human readable | |
| # format | |
| du -s * | sort -n | cut -f 2- | while read a; do du -hs "$a"; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import scala.util.parsing.json._ | |
| val result = JSON.parseFull(""" | |
| {"name": "Naoki", "lang": ["Java", "Scala"]} | |
| """) | |
| result match { | |
| case Some(e) => println(e) // => Map(name -> Naoki, lang -> List(Java, Scala)) | |
| case None => println("Failed.") | |
| } |