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/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' |
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
#import memcache | |
import threading | |
import time | |
import sys | |
import urllib2 | |
import random | |
url = "http://example.com/yourappplication" | |
total_num = 1000 |
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
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") |
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
//下記ソースを読んで設問に答えよ | |
function User(name){ | |
this.name = name; | |
} | |
User.prototype.introduce = function(){ | |
return "Hi! My name is " + this.name; | |
}; |
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
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> | |
PREFIX geo:<http://www.w3.org/2003/01/geo/wgs84_pos#> | |
PREFIX geo:<http://www.w3.org/2003/01/geo/wgs84_pos#> | |
PREFIX dbpedia_ont: <http://dbpedia.org/ontology/> | |
SELECT * WHERE { | |
?link rdfs:label ?title; | |
rdfs:comment ?comment; | |
geo:lat ?lat; | |
geo:long ?long. | |
?link rdf:type dbpedia_ont:Station. |
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
// 実装 : 一箇所バグあり | |
Date.prototype.strftime = (function () { | |
function strftime(format) { | |
var date = this; | |
return (format + "").replace(/%([a-zA-Z])/g, | |
function (m, f) { | |
var formatter = Date.formats && Date.formats[f]; |
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
# from string | |
addrs = Doko.parse("..\n住所\n 東京都港区芝浦3-41 \n..\n...") | |
p addrs #=> ["東京都港区芝浦3-41"] | |
# from url | |
addrs = Doko.parse("http://r.tabelog.com/tokyo/A....") | |
p addrs #=> ["神奈川県横浜市中区.."] |
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
casper = require('casper').create() | |
casper.start "http://twitter.com/sawamur" | |
casper.then -> | |
@test.assertNotVisible(".signup-only") | |
@click ".js-follow-btn:nth-of-type(1)" | |
casper.then -> | |
@test.assertVisible(".signup-only") |
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
casper.start "http://twitter.com",-> | |
@fill "form[action='https://twitter.com/sessions']" | |
,{"session[username_or_email]": "foobar","session[password]": "xxxxx"} | |
,true | |
casper.then -> | |
console.log @getCurrentUrl() | |
@click "#tweet-box-mini-home-profile" | |
casper.then -> |
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
user#foo -> server#web1 -sql-> db | |
true: -> | |
#web1 -mail-> user#foo | |
user -> server#web1 -> api#twitter | |
true: -> | |
server#web1 -> api#facebook | |
true: -> | |
db -> server#web1 | |
false: -> |
OlderNewer