Skip to content

Instantly share code, notes, and snippets.

# Get your Ruby version
$ ruby -v
# On my machine, this returns: ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10]
# So your version number is 1.8.7, patchlevel is 174
# Download the specific Ruby Version
$ wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p174.tar.bz2
# Remember to substitute your patch level: so the URL is tp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-#{version}-p#{patchlevel}.tar.bz2
// Send SMS
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
pasteboard.string = [self showDetails];
// Note that there must be a space after sms://. This is because if you
// enter @"sms://" as your URL, the SMS will open with the inbox as the view
// rather than the compose window as the view
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:// "]];
@arunthampi
arunthampi / install.sh
Created December 13, 2009 11:36 — forked from kamal/install.sh
#!/bin/sh
echo "Copying opscode.list to /etc/apt/sources.list.d"
sudo cp install/opscode.list /etc/apt/sources.list.d/opscode.list
echo "Adding opscode GPG key"
curl http://apt.opscode.com/packages@opscode.com.gpg.key | sudo apt-key add -
echo "Installing chef client"
sudo apt-get update
#include <stdio.h>
int main(int argc, char **argv) {
int x = 5;
float y = (float)x;
printf("Float value: %f\n", y);
return 0;
}
require 'rubygems'
require 'friendly'
Friendly.configure :adapter => "mysql",
:host => "localhost",
:user => "root",
:password => "",
:database => "friendly_development"
class BlogPost
$ brew install postgresql
==> Downloading http://ftp2.uk.postgresql.org/sites/ftp.postgresql.org/source/v8.4.2/postgresql-8.4.2.tar.bz2
######################################################################## 100.0%
==> ./configure --enable-thread-safety --with-bonjour --with-python --with-perl --with-gssapi --with-krb5 --with-openssl --with-libxml --with-libxsl
==> make install
==> Caveats
If this is your first install, create a database with:
initdb /usr/local/var/postgres
Automatically load on login with:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Colors</key>
<dict>
<key>Background</key>
<string>0.082 0.087 0.109</string>
<key>InsertionPoint</key>
<string>1.000 1.000 1.000</string>
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export PATH=$PATH:~/.scripts/
alias sshp='ssh -p 3456'
alias scpp='scp -P 3456'
alias ssho='ssh -p 443'
alias scpo='scp -P 443'
class UserTest < ActiveSupport::TestCase
should "act as authenticated" do
module = Authlogic::ActsAsAuthentic::Login::Methods
User.included_modules.include?(module)
end
end
class CompetitionTest < ActiveSupport::TestCase
# Of course, you define a factory for Competition using FactoryGirl
# (outside the scope of this Gist)
subject { Factory(:competition) }
should_validate_uniqueness_of :permalink
end