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
foobar |
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
<?php | |
class A { | |
protected static $foo = null; | |
function hoge() { | |
if (is_null(self::$foo)) { | |
self::$foo = new Inner(); | |
} | |
return self::$foo; | |
} | |
} |
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
require 'formula' | |
class Phpbrew < Formula | |
homepage 'https://github.com/c9s/phpbrew' | |
url 'https://github.com/c9s/phpbrew/tarball/1.8.16' | |
sha1 'ae4801d8f5c004677b7889b88ffbd4539def1d9b' | |
head 'https://github.com/c9s/phpbrew/tarball/master' | |
depends_on 'automake' |
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
class FooBar { | |
public function foo() { | |
function bar() { | |
echo "bar\n"; | |
} | |
bar(); | |
} | |
} | |
$f = new FooBar(); |
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
$ ruby -v | |
ruby 1.8.7 (2012-02-08 patchlevel 358) [i686-darwin11.3.0] | |
$ seq 1 10 | ruby -ne 'BEGIN{ a=0 }; a += $_.to_i; END{ puts a }' | |
-e:1: undefined method `+' for nil:NilClass (NoMethodError) | |
$ ruby -v | |
ruby 1.9.3p135 (2012-02-21 revision 34718) [x86_64-darwin11.2.0] | |
$ seq 1 10 | ruby -ne 'BEGIN{ a=0 }; a += $_.to_i; END{ puts a }' | |
55 |
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
$ CONFIGURE_OPTS="--with-readline-dir=/usr/local" rbenv install 1.9.3-p194 |
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
function p($obj) { error_log(var_export($obj, true)); } |
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_dump(in_array(0, array(null))); // => true | |
var_dump(array_search(0, array(null))); // => 0 | |
var_dump(array_key_exists(0, array(null => 1))); // => false | |
var_dump(0 == null); // => true |
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
package org.example.sample.audio; | |
import android.app.Activity; | |
import android.media.AudioManager; | |
import android.media.MediaPlayer; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.KeyEvent; | |
import java.io.IOException; |
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 unicode = { | |
escape: function(s) { | |
return s.replace(/^[-~]|\\/g, function(m) { | |
var code = m.charCodeAt(0); | |
return '\\u' + ((code < 0x10) ? '000' : ((code < 0x100) ? '00' : ((code < 0x1000) ? '0' : ''))) + code.toString(16); | |
}); | |
}, | |
unescape : function (s) { | |
return s.replace(/\\u([a-fA-F0-9]{4})/g, function(matched, g1) { | |
return String.fromCharCode(parseInt(g1, 16)) |