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
<?php | |
/** | |
* A simple description for this script | |
* | |
* PHP Version 5.2.0 or Upper version | |
* | |
* @package SampleGetBlockContent | |
* @author Hidehito NOZAWA aka Suin <http://ryus.co.jp> | |
* @copyright 2010 Hidehito NOZAWA | |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU GPL v2 |
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
<?php | |
/* | |
CREATE TABLE `transaction_test` ( | |
`id` int(11) unsigned NOT NULL AUTO_INCREMENT, | |
`name` varchar(255) NOT NULL DEFAULT '', | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
*/ |
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
<?php | |
array( | |
'aaaa' => 'aaaa', | |
'bbbb' => 'bbbb', | |
); | |
// はいいけど | |
[ | |
'aaaa' => 'aaaa', |
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
/** | |
* @constructor | |
*/ | |
var FooBar = function() {};FooBar.prototype = { /** | |
* イベントリスナ登録 | |
*/ | |
registerEventListeners: function() { | |
var self = this; | |
$(document).delegate('.foobar', 'click', function(event){ return self._foobarClickEventHandler(this, event); }); | |
}, /** |
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
<?php | |
$cases = array( | |
'ja', | |
'ja-jp', | |
'ja;q=1', | |
'da, en-gb;q=0.8, en;q=0.7', | |
); | |
foreach ( $cases as $case ) | |
{ |
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
<?php | |
class Foo | |
{ | |
} | |
class Bar extends Foo | |
{ | |
} |
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
<?php | |
class Foo | |
{ | |
public function aaa() | |
{ | |
} | |
} | |
class Bar extends Foo |
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
<?php | |
preg_replace('/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F]/', '', $string); // The line feed and carriage return will be saved. |
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
echo `date +"%Y-%m-%d %H:%M:%S"` `uptime | awk '{print $10, $11, $12}'` >> /var/log/uptime.log |
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
<?php | |
function mb_levenshtein($string1, $string2) | |
{ | |
$tokens1 = preg_split('/(?<!^)(?!$)/u', $string1); | |
$tokens2 = preg_split('/(?<!^)(?!$)/u', $string2); | |
$tokens = array_unique(array_merge($tokens1, $tokens2)); | |
if ( count($tokens) > 26 ) | |
{ |
OlderNewer