Skip to content

Instantly share code, notes, and snippets.

@sawamur
sawamur / gist:1327144
Created October 31, 2011 08:57
JS中級コース向けレベルチェック
//下記ソースを読んで設問に答えよ
function User(name){
this.name = name;
}
User.prototype.introduce = function(){
return "Hi! My name is " + this.name;
};
@sawamur
sawamur / gist:1150505
Created August 17, 2011 00:19
To convert a time in PDT to JST
require 'active_support/core_ext'
# need "core_ext" to load timezone modules
Time.zone = "Pacific Time (US & Canada)"
# There's no timezone just for 'PDT'.
t = Time.zone.parse("2011-08-22 14:00:00")
p t
# => Mon, 22 Aug 2011 14:00:00 PDT -07:00
p t.in_time_zone("Tokyo")
#import memcache
import threading
import time
import sys
import urllib2
import random
url = "http://example.com/yourappplication"
total_num = 1000
@sawamur
sawamur / eyefi_receiver.rb
Created January 12, 2010 06:02 — forked from darashi/eyefi_receiver.rb
Eye-fi reciver for sinatra
#!/usr/bin/ruby
#
# Eye-fi receiver
# -- An imcomplete implementation of Gallery Remote Protocol Server
# by SHIDARA Yoji <dara@shidara.net>
#
# see http://codex.gallery2.org/Gallery_Remote:Protocol
#
require 'fileutils'
require 'sinatra'