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 | |
function bigram($str = NULL){ | |
if( empty($str) ) { | |
return NULL; | |
} | |
if(mb_strlen($str)<=2){ | |
return array($str); | |
} |
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 | |
function base53($num) { | |
if(!is_numeric($num) && !is_string($num)){ | |
return false; | |
} | |
/* ここの文字列は並びをランダムにするといいと思います */ | |
$base='yfgs_RDVOTwztouMKxkPQIlvjprhmCNUdJcLYqaHBnAeFZSWXiEbG'; | |
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 | |
function send_psh($url) { | |
if(empty($url)){ | |
return false; | |
} | |
$hub = 'http://pubsubhubbub.appspot.com'; | |
//$hub='http://pubsubhubbub.superfeedr.com'; | |
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 | |
if(!function_exists('parse_ini_string')){ | |
function parse_ini_string($ini, $process = false){ | |
$temp=tempnam(sys_get_temp_dir(), 'parse_ini_string'); | |
file_put_contents($temp, $ini); | |
$parse = parse_ini_file($temp, $process); | |
unlink($temp); | |
return $parse; | |
} |
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 | |
function console_log($data = NULL) { | |
if (!function_exists('json_encode')) { | |
echo '<pre>'; | |
var_dump($data); | |
echo '</pre>'; | |
return false; | |
} |
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
/* | |
$('table thead th').diagonaline({ | |
color:'#666',//線の色 | |
leftTop:true//線を左上から右下にひく場合はtrue、逆はfalse | |
}); | |
*/ | |
(function($){ | |
// CSS3 Transformに対応しているかどうか |
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($){ | |
var wh,is_transition,opened,ht; | |
var cookieKey='notifyBar'; | |
var types={ | |
normal:{ | |
wrap:{ | |
'background-color':'#ffffff', | |
'border-bottom-color':'#cccccc' |
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($) { | |
var set = function(objs, cols) { | |
var _pw, attached, removed, _objs = new Array(), arr = new Array(), m, c, h,ts,t, ol=objs.length, l=ol-1, s; | |
if(!cols) { | |
cols = ol; | |
} | |
for(var i = 0; i < ol; i++) { | |
ts = objs[i]; |
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(w){ | |
var is_ael = ('function' == (typeof w.addEventListener) ), | |
is_ae = ( 'object' == (typeof w.attachEvent) ), | |
init = function() { | |
var d = document; | |
//placeholder属性がサポートされていれば無視 | |
if ( 'placeholder' in d.createElement('input') ) { | |
return false; |
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 | |
//処理できる数値は11桁まで。それ以上は意図しないものが返ります。 | |
function base51($val) { | |
$alphabet='-_abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'; | |
if (is_numeric($val)) { | |
$base_count = 51; | |
$result = ''; | |
while ($val >= $base_count) { | |
$div = $val/$base_count; |