Skip to content

Instantly share code, notes, and snippets.

View anildigital's full-sized avatar
:octocat:

Anil Wadghule anildigital

:octocat:
View GitHub Profile
# 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')
/LOG OPEN -targets #railsconf ~/irclogs/railsconf/railsconf_%Y-%m-%d
/LOG OPEN -targets #fana ~/irclogs/fanalog-%Y-%m-%d [encrypted]
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;
# Useful s3 commands
s3sync -r docs anilwadghule:
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
var checkboxes = YAHOO.util.Selector.query("input[type=checkbox]", "add_from_address_book");
var length = checkboxes.length;
for(var i=0; i < length; i++) {
checkboxes[i].checked = true;
}
With:
require 'bleak_house'
mongrel_rails start
Error comes:
This build of Ruby has not been successfully patched for BleakHouse.
$ ruby -v
ruby 1.8.6 (2007-06-07 patchlevel 36) [i486-linux]
$ sudo gem install bleak_house
Building native extensions. This could take a while...
ERROR: Error installing bleak_house:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb install bleak_house
extconf.rb:3:in `exec': No such file or directory - ruby-bleak-house build_snapshot.rb (Errno::ENOENT)
from extconf.rb:3
@anildigital
anildigital / pless.sh
Created November 12, 2008 17:34 — forked from defunkt/pless.sh
# my new favorite bashrc function
# quickly inspect source files in style
function pless {
pygmentize $1 | less -r
}
class Array
def second
self[1]
end
end