Skip to content

Instantly share code, notes, and snippets.

View anildigital's full-sized avatar
:octocat:

Anil Wadghule anildigital

:octocat:
View GitHub Profile
#!/bin/bash
echo -e "tell application \"Quicksilver\"\nshow large type \"$1\"\nend tell" | osascript
%w|rubygems sinatra|.each{|_|require _}
%w|gem load|.each{|_| send _, 'kitty'}
(k=Kitty).send *%w(define_method print) do |*a| a.join end
get "/" do content_type "text/plain" and k.new.random_kitty end
# gem install kitty
# ruby kitty_server.rb &
# curl http://localhost:4567
.mouse, #preview{
position: absolute;
background-repeat: no-repeat;
height: 22px;
min-width: 15px;
z-index: 100;
}
.mouse{
background-image: url('../images/cursor.png');
require 'java'
20_000.times do
Class.new do
include java.util.Comparator
end.new
end
@lucashungaro
lucashungaro / links.textile
Created August 14, 2010 16:36
Links de referência utilizados em minha palestra
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@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'
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
@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
send_file '/path/to/404.html', :type => 'text/html; charset=utf-8', :status => 404
render :file => "public/404.html", :status => 404, :layout => false