.gitattributes
プロジェクト直下またはホームディレクトリの .gitattributes に次の行を追加する
例. 拡張子 db を binary ファイルとして扱いCRLF変換もdiffも無効にする
1 |
*.db binary |
プロジェクト直下またはホームディレクトリの .gitattributes に次の行を追加する
1 |
*.db binary |
1 2 3 4 5 |
$ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=16.04 DISTRIB_CODENAME=xenial DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS" |
確認環境: Ubuntu 16.04.1 LTS
1 2 3 |
$ sudo mv /etc/localtime /etc/localtime.org $ sude ln -s /usr/share/timezoneinfo/Asia/Tokyo /etc/localtime |
※ 再起動の必要なし
1 2 |
$ xcode-select --print-path /Applications/Xcode.app/Contents/Developer |
1 |
$ sudo xcode-select --switch /Application/Xcode.app/Contents/Developer |
1 |
$ sudo xcode-select --switch /Application/Xcode8.1.app/Contents/Developer |
1 |
$ sudo xcode-select -r |
(App Storeから)Xcodeをバージョンアップしたあとは、このコマンドでCLIで参照するXcodeのパスを切り替えるのが簡単!
1 |
$ sudo xcode-select --install |
1 2 3 4 5 6 7 8 9 10 11 |
$ sudo cat /etc/hosts sudo: unable to resolve host MYHOSTNAME 127.0.0.1 localhost # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts |
1 2 3 4 5 6 |
$ git branch -a * master xyz remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/xyz |
1 2 3 4 |
$ git branch -r remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/xyz |
Java における byte[] と String の相互変換
1 2 |
String str = "Hello"; byte[] bytes = str.getBytes("UTF-8"); |
1 2 |
byte[] bytes = {72, 101, 108, 108, 111}; String str = new String(bytes, "UTF-8"); |
JavaScript (ECMAScript 6) の 分割代入 (Destructuring assignment)
1 2 3 4 5 6 7 |
const obj = {name:'Jane', age:18}; const {name:s, age:i} = obj; // s = 'Jane' ; i = 18 const {name, age} = obj; // name = 'Jane' ; age = 18 |
1 |
const {dialog} = require('electron').remote; |
以下のコードと等価
1 2 |
const remote = require('electron').remote; const dialog = remote.dialog; |
Visual Studio CodeをmacOSのコマンドライン(シェル)から起動可能にする設定
1 |
$ code readme.txt |
16進数表記 | 略語 | 英語 | 日本語 | エスケープ表記 |
---|---|---|---|---|
0x0d | CR | Carriadge Return | 復帰文字 | \r |
0x0a | LF | Line Feed | 改行文字 | \n |
OS | 改行コード |
---|---|
Windows | CR + LF |
UNIX, macOS (OS X) | LF |
Mac OS 9 | CR |