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' | |
require 'rss' | |
if ARGV.length.zero? | |
puts "Usage: twit.rb [twitter_handle]" | |
exit | |
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
set_trace_func proc { |event, file, line, id, binding, classname| | |
printf "%28s %8s %s:%-2d %10s %8s\n", Time.now, event, file, line, id, classname | |
} | |
puts "*** Hello World\n" |
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
# Paste all the urls (newline separated) into a file named "urls" in the following format. | |
# [http://www.flickr.com/photos/example/123456789] | |
u = File.open('urls').readlines | |
h = {} | |
u.each{|url| url.strip!; h[url].nil? ? h[url]=1 : h[url]+=1 } | |
h.sort{|a,b| a[1] <=> b[1]}.reverse.each{|x| puts "#{x[0].chomp} => #{x[1]}"} |
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
# userdir simulation | |
location ~ /~([^/]+)($|/.*)$ { | |
alias /home/$1/public_html$2; | |
error_page 404 = @404; | |
autoindex on; | |
} | |
location @404 { | |
return 404; | |
} |
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 ActionDispatch::Routing::Mapper | |
def draw(routes_name) | |
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
end | |
end | |
BCX::Application.routes.draw do | |
draw :api | |
draw :account | |
draw :session |
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
set :application, "brogram" | |
# more configs | |
set :deploy_to, "/deploy/path/webapps/#{application}" | |
set :shared_path, "#{deploy_to}/shared" | |
set :etc_path, "/etc/brogram" | |
# more configs |
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 'grit' | |
require 'test/unit' | |
REPO_PATH = ARGV[0] | |
if ARGV.empty? | |
puts "Usage: test_rogit.rb [PATH_TO_GIT_REPO]" | |
exit |
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
import unittest | |
class AutoTest(unittest.TestCase): | |
def check(self, x, y): | |
self.assertEquals(x, y) | |
for x in xrange(0,4): | |
for y in xrange(0, 4): | |
def lcheck(x, y): | |
return lambda self: self.check(x, y) |
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 | |
tag1 = ARGV[0] | |
tag2 = ARGV[1] | |
cmd=`git log #{tag1}..#{tag2} --pretty='format:%ci::%an <%ae>::%s'` | |
list = {} | |
list_order = [] | |
cmd.split("\n").each do |l| | |
date, author, subject = l.chomp.split("::") | |
date, time, zone = date.split(" ") |
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
;;; treetop-mode.el --- Major mode for editing Treetop files | |
;; Copyright (C) 1994, 1995, 1996 1997, 1998, 1999, 2000, 2001, | |
;; 2002,2003, 2004, 2005, 2006, 2007, 2008 | |
;; Free Software Foundation, Inc. | |
;; Author: Anurag Patel | |
;; Adapted from original work by: Yukihiro Matsumoto, Nobuyoshi Nakada | |
;; URL: http://www.emacswiki.org/cgi-bin/wiki/TreetopMode | |
;; Created: Fri Jun 8 02:01:00 IST 2013 |
OlderNewer