Skip to content

Instantly share code, notes, and snippets.

View anildigital's full-sized avatar

Anil Wadghule anildigital

View GitHub Profile
View gist:62
Gist concept is nice!
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)
def thread1(thread_name) do
for i in (1..10)
puts "in #{thread_name} Thread"
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'
@return_data = your_method(@your_data)
result = RubyProf.stop
printer =
path = File.join(RAILS_ROOT, 'public', 'profiling_output.html')
View gist:18137
upstream {
server {
listen 80;
#rewrite ^/(.*) permanent;
View gist:20060
# Useful s3 commands
s3sync -r docs anilwadghule:
View x
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