mkdir foo
cd foo
curl -o "Vagrantfile" "https://gist.githubusercontent.com/masuidrive/20049711692b5f5885c8/raw/171c5027732476f433b6cb97963382e3896fada0/Vagrantfile"
vagrant up && vagrant ssh
# 以下、vagrant内
cd /vagrant
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
var foo = "global"; | |
function hoge(){ | |
foo = "(/・ω・)/" //globalスコープのfoo = "global"を書き換えると見せかけてそうではない | |
var foo = "local"; //ここで var foo を宣言しているのでスコープ内のfooは全てこのローカルなfoo | |
}; | |
hoge(); | |
console.log(foo); //-> global | |
/* | |
_人人 人人 人人 人人_ | |
> (/・ω・)/じゃない < |
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
//varを付けずに宣言した変数は、宣言箇所がローカルスコープ内でも勝手にグローバル変数になる | |
function hoge(){ | |
foo = "(/・ω・)/"; | |
var bar = "(」・ω・)」"; | |
}; | |
hoge(); | |
console.log((typeof foo=="undefined")?undefined:foo); //-> (/・ω・)/ | |
console.log((typeof bar=="undefined")?undefined:bar); //-> undefined |
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
//以下のコードをiOS8の実機で実行すると、メモリが逼迫しアプリがクラッシュします。 | |
//iPad 3rd iOS8.1 | |
for (int i = 0; i<200000; i++) { | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
if (i % 100 == 0) NSLog(@"%s:%d:%d",__PRETTY_FUNCTION__,__LINE__,i); | |
NSURLRequest *req = [[NSURLRequest alloc] initWithURL: | |
[NSURL URLWithString:@"http://127.0.0.1/404.html"] | |
cachePolicy:NSURLRequestReloadIgnoringCacheData | |
timeoutInterval:100000000000]; // ダウンロード元URL |
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
# rbenv versions # インストール済みRuby一覧 | |
# rbenv install -l # インストール可能なRuby一覧 | |
# rbenv install 2.0.0-p481 # インストール | |
rbenv local 2.0.0-p481 # ディレクトリで利用するRubyの指定 |
In August 2007 a hacker found a way to expose the PHP source code on facebook.com. He retrieved two files and then emailed them to me, and I wrote about the issue:
http://techcrunch.com/2007/08/11/facebook-source-code-leaked/
It became a big deal:
http://www.techmeme.com/070812/p1#a070812p1
The two files are index.php (the homepage) and search.php (the search page)
NewerOlder