Skip to content

Instantly share code, notes, and snippets.

View anildigital's full-sized avatar

Anil Wadghule anildigital

  • Pune, India
  • 10:18 (UTC +05:30)
View GitHub Profile
@sreeix
sreeix / app.js
Created April 20, 2011 18:58
Node JS. chat client.
var http = require('http'),
express = require("express"),
sys = require("sys"),
io = require('socket.io');
var app = express.createServer();
app.set('view engine', 'jade');
app.get("/", function(req, res){
@sstephenson
sstephenson / config.ru
Created April 8, 2011 04:46
Rackup file for Rails 2.3 apps
require File.dirname(__FILE__) + '/config/environment'
run ActionController::Dispatcher.new
@anildigital
anildigital / nuke.rb
Created February 6, 2011 17:06 — forked from radar/nuke.rb
require 'rubygems'
require 'mechanize'
require 'httparty'
# Ugly code, for an ugly hack.
# Hey, if Lighthouse didn't suck then none of this would happen.
# It's been lotsa fun coding it though, so I suppose I should be thankful for the "opportunity"
@bryanl
bryanl / campfire-emoji.txt
Created January 27, 2011 16:34
campfire emoji
Surround these with : e.g. :calling:
+1
-1
bulb
calling
clap
cop
email
feet
@mig
mig / init.el
Created January 18, 2011 21:00
Simple Emacs 24 configuration for Rails development
;; emacs configuration
(push "/usr/local/bin" exec-path)
(add-to-list 'load-path "~/.emacs.d")
(setq make-backup-files nil)
(setq auto-save-default nil)
(setq-default tab-width 2)
(setq-default indent-tabs-mode nil)
(setq inhibit-startup-message t)
@nahi
nahi / RubyProcess.java.diff
Created December 27, 2010 05:10
httpclient is the fastest. benchmark.rb of JRuby can only measure elapsed time (at present)... Please see 'real' part.
diff --git a/src/org/jruby/RubyProcess.java b/src/org/jruby/RubyProcess.java
index 4d16468..ac6a105 100644
--- a/src/org/jruby/RubyProcess.java
+++ b/src/org/jruby/RubyProcess.java
@@ -29,6 +29,10 @@
***** END LICENSE BLOCK *****/
package org.jruby;
+import java.lang.management.ManagementFactory;
+import java.lang.management.ThreadMXBean;
send_file '/path/to/404.html', :type => 'text/html; charset=utf-8', :status => 404
render :file => "public/404.html", :status => 404, :layout => false
@jferris
jferris / new.rb
Created November 5, 2010 18:23
New FactoryGirl definition syntax
FactoryGirl.define do
sequence :email do |n|
"user#{n}@example.com"
end
factory :user do
email
password "test"
aliased_as :author
end
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_HEAP_SLOTS_INCREMENT=1000000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=1000000000
export RUBY_HEAP_FREE_MIN=500000
@wycats
wycats / gist:639657
Created October 22, 2010 00:09 — forked from evanphx/gist:639646
require 'rubygems'
require 'benchmark'
require 'erb'
require 'erubis'
require 'bundler'
#gem 'haml', '3.0.21'
# gem 'haml', '3.1.0.alpha.14'
require 'haml'