This file contains 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
var place_list = [ | |
// Games | |
{'name': '河洛客棧', 'lat': 25.9, 'lon': 22.9}, // 金庸群俠傳 - 河洛客棧(259, 229) | |
// TV Shows | |
{'name': 'Walt\'s House', 'lat': 35.126407, 'lon': 106.536532}, // Breaking Bad 絕命毒師 | |
{'name': 'Winterfell', 'lat': 56.185096, 'lon': -4.050264}, // Game of Thrones 權力的遊戲 | |
{'name': '思い出横丁', 'lat': 35.693267, 'lon': 139.699624}, // 深夜食堂 | |
{'name': 'St Bart\'s Hospital', 'lat': 51.518524, 'lon': -0.102420}, // Sherlock 神探夏洛克 | |
// Movies | |
{'name': 'West 57th Street', 'lat': 40.767518, 'lon': -73.984131}, // Taxi Driver 出租車司機 |
This file contains 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
/** | |
* Usage: | |
* <form hide-keyboard></form> | |
*/ | |
angular.module('hideKeyboardDirective', []) | |
.directive('hideKeyboard', ['$rootScope', function ($rootScope){ | |
return { | |
restrict: 'A', | |
controller: function (){ |
This file contains 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
html { | |
height: 100%; | |
overflow: hidden; | |
} | |
body { | |
height: 100%; | |
overflow: auto; | |
} |
This file contains 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
/** | |
* the HTML5 autofocus property can be finicky when it comes to dynamically loaded | |
* templates and such with AngularJS. Use this simple directive to | |
* tame this beast once and for all. | |
* | |
* Usage: | |
* <input type="text" autofocus> | |
*/ | |
angular.module('autofocusDirective', []) | |
.directive('autofocus', ['$rootScope', '$window', '$timeout', function ($rootScope, $window, $timeout){ |
This file contains 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
input, button { | |
-webkit-font-smoothing: antialiased !important; | |
} |
This file contains 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
1. 本地生成公私钥:ssh-keygen -t rsa | |
2. 复制 id_rsa.pub 到 远端 .ssh/authorized_keys(权限:644) | |
3. 修改配置 /etc/ssh/sshd_config | |
- RSAAuthentication yes | |
- PubkeyAuthentication yes | |
- AuthorizedKeysFile .ssh/authorized_keys | |
- 可选:PasswordAuthentication no | |
This file contains 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
PID:標識和區分進程的 ID | |
- 隨機分配 | |
- PPID:父進程的 ID | |
* PID 為 1 的進程由內核創建的 init 進程 | |
進程狀態 | |
- R(running, 0) | |
- S(sleeping, 1) | |
- D(disk sleep, 2):不可中斷睡眠狀態 | |
- T(stopped, 4) |
This file contains 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
Application | |
- app.locals:定義本地變量 | |
- app.mountpath:獲取 mounted 的 sub app 的路徑 | |
- app.all():匹配所有 HTTP verbs | |
- app.engine():註冊渲染引擎 | |
- app.listen():監聽端口 | |
- app.param():給指定 paramter 添加 callback | |
- app.set() / app.get( ):設置 / 獲取常量 | |
- app.user():安裝中間件 | |
* 設置靜態文件訪問:app.use(express.static(__dirname + '/public')) |
This file contains 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
算法:RSA / DSA / ECDSA | |
- 通常使用 RSA | |
- ECDSA 尚未被 CA 廣泛支持 | |
- SSH 通常使用 RSA 和 DSA | |
- 2048-bits RSA and DSA, at least 512-bits ECDSA | |
- Passphrase | |
- 確保 Key 可以安全地 存放、傳輸、備份 | |
- 每次重啓服務器或操作 Key 時候,都要輸入密碼 | |
文件類型 |
NewerOlder