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 ruby | |
require 'net/http' | |
EMAIL = 'メールアドレス' | |
PASS = 'パスワード' | |
HOME = 'http://kksg.tumblr.com' #アップロードするTumblrのurl | |
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
sys = require 'sys' | |
events = require 'events' | |
util = require 'util' | |
OAuth = require('oauth').OAuth | |
class TwitterUserstream extends events.EventEmitter | |
constructor: (args, initializer) -> | |
@consumerKey = args.consumerKey | |
@consumerSecret = args.consumerSecret | |
@accessToken = args.accessToken |
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
# coffee_script_tag | |
# Usage: | |
# | |
# <%= coffee_script_tag do %> | |
# alert 'Hello World' | |
# <% end %> | |
# | |
# | |
# You will get in your page: | |
# |
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
# -*- coding: utf-8 -*- | |
require 'oauth2' | |
require 'sinatra' | |
require 'httparty' | |
require 'yaml' | |
enable :sessions | |
# コンシューマキーとシークレットを設定 | |
configure do | |
config = YAML.load_file("setting.yml") #yaml形式で設定を書いた |
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
request = require('request') | |
jsdom = require('jsdom').jsdom; | |
jquery = require('jquery') | |
fs = require 'fs' | |
fetch = (uri,fn)-> | |
request uri:uri, (error, response, body)-> | |
fn error,jquery.create jsdom(body).createWindow() | |
save = (path)-> |
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
ary=gets.chomp.split('');tweet=[];140.times{tweet<<ary[rand(ary.size)]};p(tweet.join) | |
#=> ruby glitch_tweet.rb | |
#=> もう何も恐くない | |
#=> "何いな何もくうなういう何いくく恐うもなももも何ななもううもももも恐恐何く何くいもくももう何恐なく何いなな何ななもううも恐うくももくもうもうい何何何もくな恐何何もな何いくいいう何なもういもいくうく恐いいくも何くいい何うもももくなうくくもくなもなううないなくももなく恐くう恐いも何くい" |
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
#coding: utf-8 | |
require 'twitter' | |
Twitter.configure do |config| | |
config.consumer_key = YOUR_CONSUMER_KEY | |
config.consumer_secret = YOUR_CONSUMER_SECRET | |
config.oauth_token = YOUR_OAUTH_TOKEN | |
config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET | |
end |
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
class Object | |
def to_php | |
self.inspect.gsub( /[\[{]/, 'array(' ).gsub( /[}\]]/, ')' ) | |
end | |
end |
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
// ==UserScript== | |
// @id A smart dashboard have my id | |
// @name A smart dashboard have my id | |
// @namespace http://mitukiii.jp/ | |
// @author mitukiii | |
// @version 0.0.3 | |
// @update 2012-02-16T03:26:28.351Z(GMT+09:00) | |
// @description TumblrのDashboardで自分からReblogされた/自分のidを含んだpostを折り畳むスクリプト | |
// @include http://www.tumblr.com/dashboard* | |
// @include http://www.tumblr.com/show/* |
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
# メソッド単位に describe で分割するパターン | |
require 'spec_helper' | |
module Codebreaker | |
describe Marker do | |
let(:secret) { '1234' } | |
describe '#exact_match_count' do | |
subject { Marker.new(secret, guess).exact_match_count } |