超雑にまとめました。修正してください。
登場人物
- アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
- 後輩: 頼んでばっかしで役に立たない。
- サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
- プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。
<?php | |
/** | |
* mb_str_pad | |
* | |
* @param string $input | |
* @param int $pad_length | |
* @param string $pad_string | |
* @param int $pad_type | |
* @return string |
<?php | |
define('FOO', 1); | |
define('BAR', 2); | |
// 変数展開が「{$」で始まっている場合、関数の実行等が可能です。 | |
$c = 'constant'; | |
echo "FOO: {$c('FOO')}, BAR: {$c('BAR')}" . PHP_EOL; // => FOO: 1, BAR: 2 |
# language: ja | |
フィーチャ: 初めてのフィーチャ | |
PHPerとして | |
PHP 5.3.2以降を使いたい | |
なぜならSymfony2が動作する必須要件だからだ | |
シナリオ: PHPのバージョンを調べる | |
もし PHPのバージョン番号を取得する | |
ならば 取得したバージョン番号が "5.3.2" 以上であること |
[PHP] | |
;;;;;;;;;;;;;;;;;;; | |
; About php.ini ; | |
;;;;;;;;;;;;;;;;;;; | |
; PHP's initialization file, generally called php.ini, is responsible for | |
; configuring many of the aspects of PHP's behavior. | |
; PHP attempts to find and load this configuration from a number of locations. | |
; The following is a summary of its search order: |
var build_query = function (obj, num_prefix, temp_key) { | |
var output_string = [] | |
Object.keys(obj).forEach(function (val) { | |
var key = val; | |
num_prefix && !isNaN(key) ? key = num_prefix + key : '' |
// Reference | |
// http://tools.ietf.org/html/rfc6455 | |
// http://www.w3.org/TR/2011/WD-websockets-20110929/ | |
// https://github.com/einaros/ws | |
// https://github.com/Worlize/WebSocket-Node | |
// http://ja.wikipedia.org/wiki/WebSocket | |
// http://www.slideshare.net/You_Kinjoh/javascript-websocket P.68 | |
// http://d.hatena.ne.jp/gtk2k/20120203/1328274962 | |
var log = console.log.bind(console); |
// Create our server | |
var server; | |
server = http.createServer(function(req,res){ | |
// Set CORS headers | |
res.setHeader('Access-Control-Allow-Origin', '*'); | |
res.setHeader('Access-Control-Request-Method', '*'); | |
res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET'); | |
res.setHeader('Access-Control-Allow-Headers', '*'); | |
if ( req.method === 'OPTIONS' ) { | |
res.writeHead(200); |
Application > Terminalを起動したとき,環境変数の追加その他もろもろを自動でやってほしいとき,.bashrcを編集すればよい.
初期状態では,ホームディレクトリに.bashrcファイルはないので,自分で作成する.
cd ~
vi .bashrc
例えばPATH
に何かを追加したいときは,以下を足して保存.