Skip to content

Instantly share code, notes, and snippets.

View tobynet's full-sized avatar

tobynet tobynet

  • Toyama, Japan
View GitHub Profile
@tobynet
tobynet / miku_beam.rb
Last active August 29, 2015 14:00 — forked from firstspring1845/miku_beam.rb
Mikutter プラグインのみくビームを汎用的にして、earthquake.gem pluginに移植
# -*- coding: utf-8 -*-
#
# Miku beam plugin for earthquake.gem
#
# Usage:
# :mikubeam
# update 'みくビーム!みくみくみくみくwwwwwwww'
#
# :javabeam ねこ
# update 'ねこビーム!ねこねこねこねこwwwwwwww'
# -*- coding: utf-8 -*-
Plugin.create :miku_beam do
command(:miku_beam,
name: 'みくビーム',
condition: lambda{ |opt| true},
visible: false,
role: :window) do |opt|
Service.primary.post(:message => 'みくビーム!みくみくみくみくwwwwwwww')
end
end
@tobynet
tobynet / javabeam.rb
Last active August 29, 2015 14:00 — forked from firstspring1845/java_beam.rb
Mikutter のプラグインJavaビームプラグインをearthquake.gem Pluginに移植したもの
# -*- coding: utf-8 -*-
# Java beam plugin for earthquake.gem
#
# Usage:
# :javabeam
# update 'Javaビームビビビビビビビwwwwwwwwww'
#
# :javabeam 猫
# update '猫ビームビビビビビビビwwwwwwwwww'
#
@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 <[email protected]>
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