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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 -*- | |
""" | |
Author : wg_koro | |
Update : 2013/7/10 | |
Web page checker | |
""" | |
import urllib |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8'> | |
<title>おせろ</title> | |
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> | |
<style> |
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
<?php | |
// 結果:例外なげてもファイルに書き込まれる | |
try { | |
$fp = fopen('./fugafuga.log', 'a'); | |
fwrite($fp, '123'); | |
fclose($fp); | |
throw new Exception('e'); | |
} | |
catch(Exception $e) { |
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 sys, string | |
alphabet = 'abcdefghijklmnopqrstuvwxyza' | |
table = string.maketrans(alphabet[:-1], alphabet[1:]) | |
for s in sys.stdin: | |
while not('the' in s or 'this' in s or 'that' in s): | |
s = s.translate(table) |