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
プロトタイプチェーンによる継承で、基本だと思うんですが、16行目で Employee.prototype = new Person; ってやった時に、Personのコンストラクタが走るのが微妙です。 | |
何か認識を間違っているのかしら? |
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
コンストラクタを用いた継承のアプローチ。 | |
オブジェクト生成の度に、各オブジェクトのメソッドとして関数オブジェクトを生成されるのかしら? |
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 | |
$services_json = getenv('VCAP_SERVICES'); | |
$services = json_decode($services_json, true); | |
$config = null; | |
foreach ($services as $name => $service) { | |
if (0 === stripos($name, 'mysql')) { | |
$config = $service[0]['credentials']; | |
break; | |
} |
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 | |
register_shutdown_function('cconsole::flush'); | |
class cconsole | |
{ | |
private static $logs = array(); | |
private static $prefix = '[php] '; | |
private static $timers = array(); |
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 | |
/** | |
* Output the contents of the variable along with the file and line number. | |
* @param mixed $var output variable of any types. | |
* @param string $label optional. default is null. | |
* @param boolean $echo optional. default is true. | |
* @return void | |
*/ | |
function debug( $var, $label=null, $echo=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
1. svn の trunk の中で git init | |
2. ~/.subversion/config に以下を記述して git リソースなどを svn 管理下から除外する | |
global-ignores = .DS_Store Thumbs.db .git .gitignore | |
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(func){ | |
var jq = document.createElement('script'); | |
jq.src = '//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js'; | |
jq.async = 1; | |
jq.onload = function() { | |
document.body.removeChild(jq); | |
func(jQuery.noConflict(true)); | |
}; | |
document.body.appendChild(jq); | |
})(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
<?php | |
/** | |
* echo のエイリアス | |
* @return void | |
*/ | |
function e($text) { | |
echo $text; | |
} |
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() { | |
if (!window.Modernizr) { | |
return; | |
} | |
var ua = new String(window.navigator.userAgent.toLowerCase()); | |
ua.has = function (cond) { | |
return this.indexOf(cond) != -1; | |
}; |
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 | |
/** | |
* This is alias of the flash::next() for conbinience. | |
* @param $class | |
* @param $content | |
*/ | |
function flash($class, $content) { | |
flash::next($class, $content); | |
} |
OlderNewer