This file contains hidden or 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
# | |
#= dump database to yaml for fixtures | |
# | |
# originated by elm200 <http://d.hatena.ne.jp/elm200/20070928/1190947947> | |
# | |
#== install | |
# | |
# move this file to RAILS_ROOT/lib/tasks/extract_fixtures.rake | |
# | |
namespace :db do |
This file contains hidden or 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== | |
// @name 2ch Star | |
// @namespace http://aerial.st/ | |
// @include http://*.2ch.net/test/read.cgi/* | |
// @include http://p2.2ch.net/p2/read.php?* | |
// @version 0.2 | |
// ==/UserScript== | |
// | |
// add Hatena Star on messages of 2ch (*.2ch.net, p2.2ch.net) |
This file contains hidden or 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 | |
# | |
#= Password Generator | |
# | |
# check strength with cracklib | |
# | |
#== Usage | |
# | |
# $ pwdgen |
This file contains hidden or 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 | |
module Searchable | |
def search(params={}) | |
return self.scoped if params.nil? | |
params.reject{|k,v|v.blank?}.to_a.inject(self) do |base,param| | |
base.send(param.first, param.last) | |
end | |
end | |
def self.extended(base) |
This file contains hidden or 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 | |
if ARGV.size < 2 | |
puts "Usage: jamie file command" | |
exit(0) | |
end | |
target = ARGV[0] | |
cmd = ARGV[1] |
This file contains hidden or 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 'optparse' | |
require 'webrick' | |
include WEBrick | |
# WEBrickを起動する際のオプションのデフォルト値 | |
WebrickOptions = { | |
:Port => 8000, | |
:DocumentRoot => Dir::pwd, |
This file contains hidden or 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
install Japanese translate files | |
/Users/foo/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/net/http.rb:560:in `initialize': Connection refused - connect(2) (Errno::ECONNREFUSED) | |
from /Users/foo/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/net/http.rb:560:in `open' | |
from /Users/foo/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/net/http.rb:560:in `connect' | |
from /Users/foo/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/timeout.rb:53:in `timeout' | |
from /Users/foo/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/timeout.rb:101:in `timeout' | |
from /Users/foo/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/net/http.rb:560:in `connect' | |
from /Users/foo/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/net/http.rb:553:in `do_start' | |
from /Users/foo/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/net/http.rb:542:in `start' | |
from /Users/foo/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/net/http.rb:1035:in `request' |
This file contains hidden or 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/zsh | |
PATH=/usr/bin:$PATH | |
EDITOR=/usr/bin/vim | |
if [ -d /usr/local/lib ]; then | |
sudo mv /usr/local/lib /usr/local/lib.bak | |
echo "moved /usr/local/lib to /usr/local/lib.bak" | |
fi |
This file contains hidden or 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 | |
# encoding: utf-8 | |
puts <<EOM | |
iヽ /ヽ | |
| ゙ヽ、 / ゙i | |
| ゙''─‐'''" l | |
,/ ゙ヽ | |
,i゙ / \ ゙ | |
i! ● ● ,l |
This file contains hidden or 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
/* | |
* Extend jQuery with functions for PUT and DELETE requests. | |
* references: | |
* http://homework.nwsnet.de/news/9132_put-and-delete-with-jquery | |
* http://stackoverflow.com/questions/4007605/using-http-put-to-send-json-with-jquery-and-rails-3 | |
*/ | |
(function($) { | |
function _ajax_request(url, data, callback, type, method) { | |
if ($.isFunction(data)) { |
OlderNewer