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 array_dot_access( $str = NULL ) { | |
if( empty($str) || !is_string($str) ) { | |
return false; | |
} | |
static $buffer=array(); | |
if( !empty($buffer[$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
var $browser = (function(){ | |
var ua = navigator.userAgent.toLowerCase(), | |
desktop = !/android|iphone|ipod|ipad|mobile|windows phone|blackberry|webos|meego/.test(ua), | |
b = { | |
ua: ua, | |
desktop: desktop, | |
mobile: !desktop, | |
android: /android/.test(ua), | |
ios: /iphone|ipod|ipad/.test(ua), | |
iphone: /iphone/.test(ua), |
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 update = function(obj, min){ | |
var br = obj.val().match(/(\r\n|\n)/gm); | |
if (br) { | |
if (br.length >= min) { | |
obj.prop('rows', br.length + 1); | |
} | |
} else { | |
obj.prop('rows', min); | |
} |
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 cipher($string = null) { | |
if (empty($string) || !is_string($string)) { | |
return false; | |
} | |
static $key = null, $iv_size = null, $prefix = null; | |
$from = 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
(function(){ | |
var radios = {}; | |
$('label').each(function(){ | |
var label = $(this), | |
input = label.find('input[type="checkbox"],input[type="radio"]').first(); | |
if (!input.length) { | |
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 | |
function linker($text = null ,$blank = false) | |
{ | |
if (empty($text)) { | |
return null; | |
} | |
$text = preg_replace('/'/', ''', $text); // IE対策 | |
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 adsenseForKeitai | |
{ | |
private $ad_url = 'http://pagead2.googlesyndication.com/pagead/ads'; | |
private $timeout = 3;//second | |
private $params = array( | |
'slot' => null, | |
'client' => null,//pub-... |
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 vars($keys = null, $value = null) | |
{ | |
static $values = array(), $buffer = array(); | |
if (empty($keys)) { | |
return $values; | |
} |
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 geohash($lat, $lon = NULL, $len = 12) | |
{ | |
if ($len < 1 || $len > 12) { | |
return false; | |
} | |
$base32Chars = array( | |
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'b', 'c', 'd', 'e', 'f', 'g', |
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 meconv($value) | |
{ | |
if (ctype_digit(strval($value))) { | |
$str = chr(96 + strlen(base_convert($value, 10, 36))); | |
$str .= base_convert($value, 10, 36); | |
$str .= md5($value); | |
return substr($str, 0, 14); | |
} elseif(is_string($value)) { |
OlderNewer