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 | |
/* | |
本番利用にはクレジット表記が必要なので注意 | |
https://labs.goo.ne.jp/apiusage/ | |
*/ | |
class gooAPI | |
{ | |
private $app_id = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx'; | |
private $api_base = 'https://labs.goo.ne.jp/api/'; |
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 japan_holiday() { | |
// カレンダーID | |
$calendar_id = urlencode('japanese__ja@holiday.calendar.google.com'); | |
// 取得期間 | |
$start = date("Y-01-01\T00:00:00\Z"); | |
$end = date("Y-12-31\T00:00:00\Z"); |
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 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
{ | |
"01": { | |
"id": "01", | |
"name": "北海道", | |
"short": "北海道", | |
"kana": "ホッカイドウ", | |
"en": "hokkaido", | |
"area": { | |
"id": 1, | |
"name": "北海道・東北" |
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 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 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
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
<?php | |
function array_dot_access( $str = NULL ) { | |
if( empty($str) || !is_string($str) ) { | |
return false; | |
} | |
static $buffer=array(); | |
if( !empty($buffer[$str]) ) { |