Skip to content

Instantly share code, notes, and snippets.

View akkunchoi's full-sized avatar

Akiyoshi Tanaka akkunchoi

View GitHub Profile
@akkunchoi
akkunchoi / watir_example.rb
Created February 2, 2012 15:34
watir example
require 'rubygems'
require 'watir-webdriver'
browser = Watir::Browser.new
browser.goto 'http://bit.ly/watir-example'
browser.text_field(:name => 'entry.0.single').set 'Watir'
browser.button(:name => 'submit').click
puts browser.title == 'Thanks!'
require 'rubygems'
require 'net/imap'
require 'kconv'
require 'pit'
require 'logger'
class ImapFetcher
def initialize(pit_name)
@pit = Pit.get(
@akkunchoi
akkunchoi / fullpath.sh
Created February 2, 2012 16:15
fullpath
#!/bin/sh
echo $(cd $(dirname $0) && pwd)/$(basename $0)
@akkunchoi
akkunchoi / make_dummy.php
Created February 2, 2012 16:19
Make dummy data
<?php
$map = array();
for ($i = 0; $i < 10; $i++){
$map[] = chr(ord('0') + $i);
}
for ($i = 0; $i < 26; $i++){
$map[] = chr(ord('A') + $i);
}
@akkunchoi
akkunchoi / gcalapi_example.rb
Created February 2, 2012 16:07
Ruby gcalapi example
# http://doruby.kbmj.com/trinityt_on_rails/20081022/Ruby_Google_
require 'rubygems'
require 'gcalapi'
$KCODE = "utf8"
# アカウントメールアドレス
mail = "{{address}}"
# パスワード
pass = "{{password}}"
# Googleカレンダーの「カレンダー設定」画面から取得した非公開URL
@akkunchoi
akkunchoi / gist:2847462
Created June 1, 2012 00:20
Apple Mail -- Text File Exporter
(*
This script is modified by akkunchoi to change filename rule.
The original source of this script is written by veritrope.com.
http://veritrope.com
Apple Mail -- Text File Exporter
Version 1.1
January 17, 2011
Project Status, Latest Updates, and Comments Collected at:
http://veritrope.com/code/export-apple-mail-messages-and-notes-to-text-files
<?php
/**
*
* $ sqlite3 hoge.db
*
* sqlite> create table hoge(id integer, name varchar(16));
* sqlite> insert into hoge values('1', 'userA');
* sqlite> .quit
*
*/
@akkunchoi
akkunchoi / .gitignore
Created June 25, 2012 17:58 — forked from butlermh/wishlist.rb
欲しい物リストをカーリルで検索 - Find out what books are available on your Amazon wishlist on Calil
config.yml
@akkunchoi
akkunchoi / markdown2html.sh
Created July 2, 2012 09:03
markdown to html
#!/usr/bin/bash
# Get Markdown.pl http://daringfireball.net/projects/markdown/
mkdir ./html
for i in foo.md bar.md
do
out=${i/.md/.html}
content=`perl ./Markdown.pl $i`
@akkunchoi
akkunchoi / loc.rb
Created July 22, 2012 00:40
Fetch address from wifi for OSX
#!/usr/bin/env ruby
#
# Fetch my current address from mac addresses on wi-fi for MacOSX
#
# via http://unknownplace.org/memo/2012/07/21/1/
#
# GeolocationAPI
# http://code.google.com/p/gears/wiki/GeolocationAPI
# Reverse Geocoding
# https://developers.google.com/maps/documentation/geocoding/?hl=ja#ReverseGeocoding