View gist:62
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
Gist concept is nice! http://twitter.com/anildigital/statuses/864375699 |
View gist:16017
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
svn status | grep "^\\?" | sed -e 's/? *//' | sed -e 's/ /\\\\ /g' | xargs rm |
View gist:16158
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
find %s | egrep \"rb$\" | xargs ctags-exuberant -a -e -f %s/TAGS --exclude=vendor --exclude=public --exclude=log --exclude=db |
View gist:16217
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 MyThread | |
def initialize(thread_name) | |
thread1(thread_name) | |
end | |
def thread1(thread_name) | |
Thread.new do | |
for i in (1..10) | |
puts "in #{thread_name} Thread" | |
sleep(1) |
View gist:16937
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 | |
# | |
# Author: Anil Wadghule | |
# | |
# FRenamer: Renames image files for passed command line parameters | |
# Usage: frenamer . "the_dark_knight" | |
# It renames image files in current directory with names like the_dark_knight_1.jpg, the_dark_knight_2.jpg ... | |
# | |
# Installation: | |
# Copy it to your /usr/bin or any directory which is in your PATH |
View gist:16970
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
/LOG OPEN -targets #railsconf ~/irclogs/railsconf/railsconf_%Y-%m-%d | |
/LOG OPEN -targets #fana ~/irclogs/fanalog-%Y-%m-%d [encrypted] |
View gist:17108
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
# Profiler starts | |
require 'ruby-prof' | |
RubyProf.start | |
@return_data = your_method(@your_data) | |
result = RubyProf.stop | |
printer = RubyProf::GraphHtmlPrinter.new(result) | |
path = File.join(RAILS_ROOT, 'public', 'profiling_output.html') |
View gist:18137
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
upstream planetrubyonrails.net { | |
server 127.0.0.1:8014; | |
server 127.0.0.1:8015; | |
} | |
server { | |
listen 80; | |
server_name planetrubyonrails.net; | |
#rewrite ^/(.*) http://planetrubyonrails.net permanent; |
View gist:20060
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
# Useful s3 commands | |
s3sync -r docs anilwadghule: |
View x
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
CmdUtils.CreateCommand({ | |
name: "page-width", | |
author: { name: "Jacky See"}, | |
license: "GPL", | |
description: "Limit the page width by a given parameter, align it to center", | |
help: "e.g. page-width 400", | |
takes: {"input": noun_arb_text}, | |
preview: function( pblock, input ) { | |
var template = "Setting page to width ${w} (default is 500)"; | |
var width = 500; //default width |
OlderNewer