Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Working from home

Anil Wadghule anildigital

:octocat:
Working from home
View GitHub Profile
View gist:62
Gist concept is nice! http://twitter.com/anildigital/statuses/864375699
View gist:16017
svn status | grep "^\\?" | sed -e 's/? *//' | sed -e 's/ /\\\\ /g' | xargs rm
View gist:16158
find %s | egrep \"rb$\" | xargs ctags-exuberant -a -e -f %s/TAGS --exclude=vendor --exclude=public --exclude=log --exclude=db
View gist:16217
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
#!/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
/LOG OPEN -targets #railsconf ~/irclogs/railsconf/railsconf_%Y-%m-%d
/LOG OPEN -targets #fana ~/irclogs/fanalog-%Y-%m-%d [encrypted]
View gist:17108
# 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
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
# Useful s3 commands
s3sync -r docs anilwadghule:
View x
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