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 geohash(lat, lon, len) | |
{ | |
if (len) { | |
len = Number(len); | |
if (len < 1 || len > 12) { | |
return false; | |
} | |
} else { | |
len = 12; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Admin Template</title> | |
<link rel="stylesheet" href="template.css"> | |
</head> | |
<body> |
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 | |
//キャッシュディレクトリ。最後は必ずスラッシュ。 | |
define('CACHE_DIR','path/to/cachedir/'); | |
//ファイルキャッシュ関数。 | |
//引数「$id」と引数「$data」に値が入るとキャッシュ保存。引数「$id」のみで引数「$data」が空ならキャッシュ参照。 | |
//引数「$id」はスラッシュ区切りでキャッシュディレクトリ内にさらにフォルダ作成(デフォルトでは「default」という名前で作成)。 | |
//引数「$data」に「false」を指定すると、該当$idのキャッシュファイルを削除。 | |
//引数「$minute」はキャッシュ時間(分単位)。キャッシュ保存時のみ必要。 |
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 kana2roma { | |
var $charset='utf-8'; | |
var $mode_Krows = 'k'; //か・く・こ(k or c) | |
var $mode_XArows = 'l'; //小文字ぁ行と「っ」( L or X) | |
var $mode_TYrows = 'ch'; //ち行+小文字や行(ty or ch or cy) | |
var $mode_SYrows = 'sh'; //し行+小文字や行(sy or sh) | |
var $mode_JYrows = 'j'; //じ行+小文字や行(j or zy or jy) | |
var $mode_Sstr = 'sh'; //し(s or sh or c) |
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
// 最初にこの関数を実行し、ログに出力されたURLにアクセスしてOAuth認証する | |
function twitterAuthorizeUrl() { | |
Twitter.oauth.showUrl(); | |
} | |
// OAuth認証成功後のコールバック関数 | |
function twitterAuthorizeCallback(request) { | |
return Twitter.oauth.callback(request); | |
} |
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
DELIMITER // | |
DROP FUNCTION IF EXISTS `PREF`// | |
CREATE FUNCTION PREF( _STR_ VARCHAR(20)) RETURNS VARCHAR(6) | |
LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA | |
BEGIN | |
DECLARE res VARCHAR(6); | |
SET res=CASE | |
WHEN _STR_='1' THEN '北海道' | |
WHEN _STR_='2' THEN '青森県' |
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 | |
/* | |
Plugin Name: Force Publish | |
Plugin URI: https://kijtra.com/article/wordpress-future-post-publish/ | |
Description: 公開日が未来の日付でも、強制的に公開状態にします。 | |
Author: kijtra | |
Version: 1 | |
Author URI: https://kijtra.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
$base: 16px; | |
$bg_positions: ( | |
mini: ( | |
w: $base, | |
h: $base, | |
x: 0, | |
y: $base | |
), | |
big: ( |
NewerOlder