Skip to content

Instantly share code, notes, and snippets.

View ashee's full-sized avatar

Amitava Shee ashee

View GitHub Profile
scala> def gt[A](x : A)(implicit m:Manifest[A]) = m
gt: [A](x: A)(implicit m: scala.reflect.Manifest[A])scala.reflect.Manifest[A]
use netselect to update your /etc/apt/sources.list file
apt-get install netselect
apt-get install netselect-apt
sudo netselect-apt -n -s stable
(into {} (System/getProperties))
def subtract(i: Int, j: Int): Int = {
require(i > 4 && j > 4)
(i - j).ensuring(_ > 4)
}
@ashee
ashee / gist:628582
Created October 15, 2010 17:28
Reload TextMate Bundles
osascript -e 'tell app "TextMate" to reload bundles'
@ashee
ashee / ssl-modrails
Created October 18, 2010 15:36
SSL redirect in modrails
LoadModule passenger_module /Applications/MAMP/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-2.2.15/ext/apache2/mod_passenger.so
PassengerRoot /Applications/MAMP/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-2.2.15
PassengerRuby /Applications/MAMP/ruby-enterprise-1.8.7-2010.02/bin/passenger_ruby
PassengerTempDir /Applications/MAMP/tmp/passenger
# PassengerUploadBufferDir /Applications/MAMP/tmp/passenger
PassengerLogLevel 3
# make a symlink from docroot to the public folder in your rails app
# cd /Applications/MAMP/htdoc; ln -s /wherever/your/appname/public appname
<VirtualHost *:8443>
@ashee
ashee / vi-modeline
Created October 20, 2010 16:23
vi - tab related modeline
/* vim: set expandtab sw=4 ts=4 sts=4: */
@ashee
ashee / kvm.config.xml
Created October 22, 2010 14:26
kvm libvirt config
<domain type='kvm'>
<name>encore-dev</name>
<uuid>c8bbf2df-c68b-63d9-6cad-cec7aa27b536</uuid>
<memory>4194304</memory>
<currentMemory>4194304</currentMemory>
<vcpu>2</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
SCRIPT="$(basename "$(test -L "$0" && readlink "$0" || echo "$0")")"
BASEDIR=$(cd `dirname $0` && pwd)
BASEDIRNAME=$(basename $BASEDIR | tr \\n \ | sed -e 's/ $//' )
# BASEDIRNAME can now be used e.g. to create a tarball
tar cvzf "${BASEDIRNAME}.tgz" target/*
@ashee
ashee / 0001-Inference-Error.patch
Created February 14, 2011 22:12
dubious patch
From a48ffde5191e65e4bcbb5ccf65be27e2ea32026c Mon Sep 17 00:00:00 2001
From: Amitava Shee <amitava.shee@gmail.com>
Date: Mon, 14 Feb 2011 14:49:34 -0500
Subject: [PATCH] Inference Error
---
dubious.gemspec | 2 +-
lib/dubious/cli.rb | 1 +
2 files changed, 2 insertions(+), 1 deletions(-)