Skip to content

Instantly share code, notes, and snippets.

View tobynet's full-sized avatar

tobynet tobynet

  • Toyama, Japan
View GitHub Profile
@tobynet
tobynet / stdout_hook_singleton_method.rb
Created May 19, 2010 01:49
Rubyでaliasを使った特異メソッドの上書き方法
#!ruby -Ku
# override_method/stdout_hook_singleton_method.rb
$KCODE = 'u'
# sample of override singleton method
require "kconv"
$stdout.sync = true
class << $stdout
@tobynet
tobynet / stdout_hook_singleton_method_with_activesupport.rb
Created May 19, 2010 01:56
RailsのActiveSupportのalias_method_chainを使ったRubyでの特異メソッドの上書き方法
#!ruby -Ku
# override_method/stdout_hook_singleton_method_with_activesupport.rb
$KCODE = 'u'
# sample of override singleton method with active_supportlike a Rails
# alias_method_chain (ActiveSupport::CoreExtensions::Module) - APIdock
# http://apidock.com/rails/ActiveSupport/CoreExtensions/Module/alias_method_chain
require "rubygems"
require "active_support"
@tobynet
tobynet / web-old-days.js
Created July 7, 2010 14:47
web 1.0 jQuery plugin at 2010-04-01 aprilfool, originaled by sixapart
/*
* This program is distributed under the terms of the
* GNU General Public License, version 2.
*
*/
(function ($) {
/*
* cursorrat
*
// ==UserScript==
// @name pixiv API
// @namespace http://efcl.info/
// @include http://www.pixiv.net/*
// ==/UserScript==
// API 資料 http://pastie.org/735195
var pxvAPI = "http://iphone.pxv.jp/iphone/"
// 検索結果のオブジェクト
var result = [];
var user = {
require 'nokogiri'
require 'open-uri'
# usage: ruby ewords.rb > keywords.txt
root_url = 'http://e-words.jp/'
indices = Nokogiri(open(root_url)).search('.index a')
result = []
indices.each_with_index { |index, i|
warn "#{i+1} / #{indices.length} #{index.text}"
#!ruby
module Kernel
def if_true(bool, &block)
if bool
block.call
return true
else
return false
end
end
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url-prefix("http://rubykaigi.org/2010/live/") {
body {
background-color: #fdfeff !important;
}
#container {
background: url("http://gyazo.com/963a9bbaf8410b311449e4457cce7085.png") repeat-x scroll 0 -10px transparent !important;
#SingleInstance
#Persistent
keys = Ctrl|Shift|Alt|LWin|RWin
alertDur = 3000 ;(ms)
SetTimer, Alerter,200
;return
goto, end_of_ctrl_alert
Alerter:
alert =
// ==UserScript==
// @name Hatena Graph Previewer
// @namespace http://twitter.com/m_satyr
// @include http://graph.hatena.ne.jp/*/edit*
// ==/UserScript==
//
// Released under the MIT license
// modified by http://twitter.com/toby_net
// see also
// http://help-me-hackers.com/tasks/133
// ==UserScript==
// @name Twitter search(ja) result on Google
// @namespace http://efcl.info/
// @include http://www.google.*/search?*
// ==/UserScript==
// original Twitter Search Results on Google for Greasemonkey [ http://userscripts.org/scripts/show/43451 ]
(function(doc){
// *config* display number
var SEARCHINTERVAL = 5;