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 |
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 |
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 |
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) |
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 |
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] |
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') |
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; |
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: |
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