
セッション(screen)の起動とアタッチ
|
1 |
$ screen |
セッション(仮想端末)の一覧
|
1 2 3 4 |
$ screen -ls There is a screen on: 2597.pts-0.GLANTANK (Detached) 1 Socket in /var/run/screen/S-admin. |
<PID>.<tty>.<host>

|
1 |
$ screen |
|
1 2 3 4 |
$ screen -ls There is a screen on: 2597.pts-0.GLANTANK (Detached) 1 Socket in /var/run/screen/S-admin. |
<PID>.<tty>.<host>
TypeScript 2.0にて、tsdはdeprecated(非推奨)に変更。typingsを代替ツールとして推奨。特別なツールは不要でnpmでも管理可能。
|
1 |
$ npm install --save @types/electron |
*.tsのソースコードにおいて reference path を記述して型定義ファイルを読み込む必要なし。(tsdを使っていないにもかかわらず読み込もうとするとエラー)
|
1 |
$ npm install tsd -g |
|
1 |
$ tsd install github-electron --save |
|
1 |
$ tsd query github-electron -rosa install |
Canvasに描画するときはonloadハンドラにて実行する
|
1 2 3 4 5 6 7 |
var ctx = document.getElementById('myCanvas').getContext("2d") var img = new Image() img.src = "myDog.png" ctx.drawImage(img, 0, 0) |
※上手くいくときもある。
|
1 2 3 4 5 6 7 8 9 |
var ctx = document.getElementById('myCanvas').getContext("2d") var img = new Image() img.src = "myDog.png" img.onload = function() { ctx.drawImage(img, 0, 0) } |
ローカル画像に限らない。
canvas.toDataURL()で画像を生成したときも同様。
node.jsのパッケージ管理をHomebrewからnodebrewに移行するための前準備
|
1 2 3 4 5 6 7 8 9 |
$ cd /usr/local/lib $ npm uninstall npm - abbrev@1.0.7 node_modules/npm/node_modules/abbrev - ansi-regex@2.0.0 node_modules/npm/node_modules/ansi-regex - ansicolors@0.3.2 node_modules/npm/node_modules/ansicolors ... - write-file-atomic@1.1.4 node_modules/npm/node_modules/write-file-atomic - npm@3.6.0 node_modules/npm |
|
1 2 |
$ brew uninstall --force node Uninstalling node... (31,538 files, 340.8M) |
Homebrewでインストールしたnode.jsのアンインストール
|
1 |
$ curl -L git.io/nodebrew | perl - setup |
|
1 |
$ nodebrew install-binary latest |
|
1 2 3 4 |
$ nodebrew list v5.7.0 current: none |
|
1 |
$ nodebrew use v5.7.0 |
|
1 2 3 4 |
$ nodebrew list v5.7.0 current: v5.7.0 |
npmはnodeと一緒にインストールされる
|
1 2 |
$ npm -v 3.6.0 |
|
1 2 |
$ which npm /Users/JaneDoe/.nodebrew/current/bin/npm |
|
1 |
$ git clone https://github.com/atom/electron-quick-start |
|
1 |
$ cd electron-quick-start |
|
1 |
$ npm install && npm start |
npmではプロジェクトのルートディレクトリにおいたpackage.jsonでモジュール(ライブラリ)のインストール管理をするため「プロジェクトの初期化」と「package.jsonの作成」は同義。
|
1 |
$ npm init |
npmで管理するプロジェクトの情報はpackage.jsonに書き込まれる。
package.jsonはテキストエディタで編集可能であるが、初回は対話式コマンドで作成するのが簡便。
|
1 |
$ npm install <module name> |
|
1 |
$ npm install electron -g |
|
1 |
$ npm install electron-prebuilt -g |
The prebuilt Electron binaryのパッケージ名変更のおしらせ
http://electron.atom.io/blog/2016/08/16/npm-install-electron
|
1 |
$ npm install electron-packager -g |
|
1 2 3 4 5 6 7 8 9 10 11 |
$ npm install electron-build -g npm ERR! Darwin 15.3.0 npm ERR! argv "/Users/JaneDoe/.nodebrew/node/v5.6.0/bin/node" "/Users/JaneDoe/.nodebrew/current/bin/npm" "install" "electron-build" "-g" npm ERR! node v5.6.0 npm ERR! npm v3.6.0 npm ERR! code E404 npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/electron-build npm ERR! 404 npm ERR! 404 'electron-build' is not in the npm registry. .... |
難しいエラーメッセージが羅列されているが、要は指定された名前のパッケージが存在しない。パッケージ名のtypoを疑おう!
上記のエラーは "buit" を "build" とtypo。
SwiftによるVisualFormat形式のオートレイアウトのコード例
UINavigationControllerにおける実装
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
// VisualFormatから参照するキーワードの辞書 let viewDictionary:Dictionary = ["MyContent": self.myContentView] let constraintFormatH:[NSLayoutConstraint] = NSLayoutConstraint.constraintsWithVisualFormat( "H:|-[MyContent]-|", options: NSLayoutFormatOptions(rawValue: 0), metrics:nil, views:viewDictionary) self.view.addConstraints(constraintFormatH) // NavigationBarの高さ:20 // ToolBarの高さ:64 let constraintFormatV:[NSLayoutConstraint] = NSLayoutConstraint.constraintsWithVisualFormat( "V:|-(20)-[MyContent]-(64)-|", options: NSLayoutFormatOptions(rawValue: 0), metrics:nil, views:viewDictionary) self.view.addConstraints(constraintFormatV) |