Skip to content

Instantly share code, notes, and snippets.

View tobynet's full-sized avatar

tobynet tobynet

  • Toyama, Japan
View GitHub Profile
@tobynet
tobynet / cakesgetter.py
Last active December 11, 2015 06:48 — forked from laiso/cakesgetter.py
ツイッター検索からcakes無料時間の記事を探してダウンロードしておくスクリプト
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
cakegetter.py
ツイッター検索からcakes無料時間の記事を探してダウンロードしておくスクリプト
"""
import os
import re
@tobynet
tobynet / deploy.rake
Created May 19, 2012 05:32 — forked from njvitto/deploy.rake
Rakefile to deploy and rollback to Heroku in two different environments (staging and production) for the same app
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
@tobynet
tobynet / mix_noun.rb
Created April 1, 2012 08:35 — forked from hitode909/mix_noun.rb
文を2つ入力して最初の文の名詞以外と2つめの文の名詞だけを使って文章を作るやつ
# -*- coding: utf-8 -*-
require 'open-uri'
require 'nokogiri'
require 'MeCab'
class WordsArray < Array
def nouns
select{ |w|
w.is_noun
}
#! /usr/bin/env ruby
puts ARGF.read.split(/\b+/).map{|x|x.split(//).sort.join }.join
@tobynet
tobynet / coderwall.rb
Created November 27, 2011 18:17 — forked from vivien/coderwall.rb
Simple and Stupid Ruby API for Coderwall.com
# Simple and Stupid Ruby API for Coderwall.com
# Vivien Didelot <vivien@didelot.org>
require "open-uri"
require "json"
module CoderWall
class Achievement
attr_reader :name, :badge, :description
@tobynet
tobynet / sanmoji.rb
Created September 27, 2011 14:40 — forked from ssig33/sanmoji.rb
require "mechanize"
alice = Mechanize.new
list = []
%w{a b c d e f g h i j k l m n o p q l s t u v w x y z 1 2 3 4 5 6 7 8 9 0}.each{|x|
%w{a b c d e f g h i j k l m n o p q l s t u v w x y z 1 2 3 4 5 6 7 8 9 0}.each{|y|
%w{a b c d e f g h i j k l m n o p q l s t u v w x y z 1 2 3 4 5 6 7 8 9 0}.each{|z|
list << x+y+z
}
}
}
require "mechanize"
alice = Mechanize.new
(0..20).each{|q|
t = q*50 + 1
page = alice.get "http://tophatenar.com/ranking/subscriber/#{t}?blog=hatena"
page.root.xpath("//td[@class='odd']/a").map{|x| x["href"].split("/").last}.uniq.each{|d|
begin
page = alice.get "http://delicious.com/register"
form = page.forms[1]
form.username = d
@tobynet
tobynet / hatebu_uzai.css
Created August 11, 2011 01:56 — forked from ssig33/hatebu_uzai.css
スッキリはてブエントリー
/*******************************************************
# これは何か
はてなのエントリーページをすっきりさせるcss
## 動作確認用
- 新ページ http://b.hatena.ne.jp/entry/www.google.co.jp/
- 旧ページ http://b.hatena.ne.jp/entry?mode=more&url=http%3A%2F%2Fwww.google.co.jp%2F
- 及び旧ページの「コメントのみ表示」チェック状態
## エントリーページ場合分け用セレクタ
@tobynet
tobynet / hanamasize_proxy.rb
Created June 12, 2011 16:01 — forked from tobynet/pixelize_proxy.rb
hanamasize proxy
#!/usr/bin/env ruby
require 'webrick'
require 'webrick/httpproxy'
require 'RMagick'
# curl -o files/hanamasa.png http://w.ikenie.com/hanamasa/hanamasa.png
handler = Proc.new() { |req,res|
if res['content-type'] =~ /png/
@tobynet
tobynet / oqunoize_proxy.rb
Created June 12, 2011 15:34 — forked from hitode909/negaproxy.rb
oquno化プロキシ
#!/usr/bin/env ruby
require 'webrick'
require 'webrick/httpproxy'
require 'RMagick'
# curl -o files/oquno-c.png http://si1.twimg.com/profile_images/96741059/oquno-c.png
handler = Proc.new() { |req,res|
if res['content-type'] =~ /png/