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 | |
/** | |
* X秒前、X分前、X時間前、X日前などといった表示に変換する。 | |
* 一分未満は秒、一時間未満は分、一日未満は時間、 | |
* 31日以内はX日前、それ以上はX月X日と返す。 | |
* X月X日表記の時、年が異なる場合はyyyy年m月d日と、年も表示する | |
* | |
* @param <String> $time_db strtotime()で変換できる時間文字列 (例:yyyy/mm/dd H:i:s) | |
* @return <String> X日前,などといった文字列 | |
**/ |
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
*** nginx-proxy-cache-purge_org.php 2012-04-09 06:22:30.000000000 +0900 | |
--- nginx-proxy-cache-purge_new.php 2013-02-04 00:35:13.000000000 +0900 | |
*************** | |
*** 13,18 **** | |
--- 13,20 ---- | |
$link = get_permalink($post_id); | |
$parse = parse_url($link); | |
$post_url = $parse[scheme].'://'.$parse[host].'/purge'.$parse[path]; | |
+ $post_url_sp = $parse[scheme].'://'.$parse[host].'/pg_s'.$parse[path]; | |
+ $post_url_ft = $parse[scheme].'://'.$parse[host].'/pg_f'.$parse[path]; |
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
#include "string.h" | |
// the setup routine runs once when you press reset: | |
void setup() { | |
Serial.begin(115200); // 速度 | |
} | |
#define _Read_MAX_CHAR_ 50 | |
// the loop routine runs over and over again forever: | |
void loop() { |
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
// Cookieに書き込む | |
function writeCookie(name, val, second){ | |
var term = second * 1000; | |
var now = new Date(); | |
var limit = new Date(); | |
limit.setTime(limit.getTime() + term); | |
document.cookie = name + "=" + escape(val) + "; path=/; expires=" + limit.toUTCString(); | |
} | |
function insertAfter(target, newElem){ |
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
/* | |
Author : wg_koro | |
Version : 1.0 | |
Update : 2012/10/24 | |
License : MIT | |
- How to use - | |
Set this script in header.That's all! :) | |
(Example) <script type='text/javascript' src='xxxx/spscroll.js' charset='utf-8'></script>. | |
*/ |
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 | |
/** | |
Author : wg_koro | |
LastUpdate : 2012/10/11 | |
License : MIT | |
URLのパラメーター文字列を分解・比較するためのクラス | |
使い方: | |
$p = new UrlParam(); |
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
// Initializing variables ================================== | |
// WiFi, BlueToothをONにする場所をセット。 | |
// http://www.geocoding.jp/ を使うと緯度経度が分かります。 | |
var location = [ | |
{ name : "tokyo_tower", latitude : "35.65861", longitude : "139.745447" }, | |
{ name : "ueno_station", latitude : "35.713768", longitude : "139.777254" } | |
]; | |
var radius = 1000; // 目標地点を中心とした半径距離。この円を境目にスイッチ稼働。単位:メートル | |
var turn_on_bluetooth = false; // BluetoothもONにするならtrueに。 |
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
""" | |
スレッドの使い方練習 | |
""" | |
import threading, time | |
import collections | |
import traceback | |
class Data: |
NewerOlder