Skip to content

Instantly share code, notes, and snippets.

View temmings's full-sized avatar
🇹🇭
Out sick

Tetsuya HAMAMOTO temmings

🇹🇭
Out sick
View GitHub Profile
# see: https://github.com/ansible/ansible/issues/10294#issuecomment-147833468
import ssl
if hasattr(ssl, '_create_default_https_context') and hasattr(ssl, '_create_unverified_context'):
ssl._create_default_https_context = ssl._create_unverified_context
class CallbackModule(object):
pass
@temmings
temmings / read-bookdata-kindle-cloud-reader.js
Last active December 18, 2015 18:53
Read book data of Kindle Cloud Reader
var d = openDatabase("K4W", "", "Kindle Cloud Reader", 5E6);
d.readTransaction(function(t) {
t.executeSql("SELECT * FROM bookdata",
[],
function(t, r) {
console.log(r.rows);
});
});
@temmings
temmings / seperate.pl
Created January 29, 2015 15:55
Do "mysqldump --routines" to separate files. (fuzzy)
#!/usr/bin/perl
#
# mysqldump -routines --no-create-info --no-data --no-create-db --compact | perl $0
use strict;
use warnings;
use utf8;
my $output_dir = "out";
@temmings
temmings / geolocation.py
Created December 13, 2014 21:15
IP から GeoIP を利用して日本の都道府県名を引く
# -*- coding: utf-8; -*-
u"""
IP から GeoIP を利用して日本の都道府県名を引く
:Author: t.hamamoto@skillupjapan.co.jp
* http://koshigoeb.hateblo.jp/entry/2012/02/19/183631
* http://www.maxmind.com/app/city
* http://www.maxmind.com/app/fips10_4
@temmings
temmings / .cvimrc
Last active August 29, 2015 14:08
cVim setting.
let blacklists = ["https://mail.google.com/*", "*://*.reddit.com/*", "*://feedly.com/*"]
unmap <C-h> "The unmaps the default 'C-h' mapping
@temmings
temmings / file0.groovy
Last active August 29, 2015 14:07
Jenkins ジョブのビルドパラメータを直近の日付選択リストにしたい ref: http://qiita.com/temmings/items/fee4c805560d4e74997e
use (groovy.time.TimeCategory) {
def today = new Date()
return (0..2).collect { i -> (today - i.days).format('YYYYMMdd') }
}
@temmings
temmings / uc2amp.pl
Last active August 29, 2015 14:01
UCカードのWEB明細CSVを Active Money Pro でインポート可能な形式に変換するスクリプト。カテゴリなどは決め打ちです。
#!/usr/bin/env perl
# -*- coding: utf-8 -*-
=head1 uc2amp.pl
description: CSV of UC card expose detail to Active Money Pro Import CSV.
=cut
# TODO:
@temmings
temmings / file0.txt
Created October 4, 2013 21:28
mkdir したディレクトリに cd する ref: http://qiita.com/temmings/items/97a943143b619987a819
function mkcdir() {
mkdir $@ || return $?
local arg got_end_option=0
for arg in "$@"; do
case "$arg" in
--)
got_end_option=1
continue
;;
@temmings
temmings / gist:5130822
Created March 10, 2013 22:38
When you play this video in full screen on 4.0.3 Android, timeupdate event is fired in the video at the bottom.
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>android4 video elements problem.</title>
<script type="text/javascript">
function logger(message) {
console.log(message);
var log = document.getElementById("log");
var li = document.createElement('li');
@temmings
temmings / force_101_keymap.reg
Created March 2, 2013 19:41
なんかしらんけど 106 Keyboard になってて発狂したときに使う
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters]
"LayerDriver JPN"="kbd101.dll"
"OverrideKeyboardIdentifier"="PCAT_101KEY"
"OverrideKeyboardSubtype"=dword:00000000