This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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:// "]]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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/[email protected] | sudo apt-key add - | |
echo "Installing chef client" | |
sudo apt-get update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(int argc, char **argv) { | |
int x = 5; | |
float y = (float)x; | |
printf("Float value: %f\n", y); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'friendly' | |
Friendly.configure :adapter => "mysql", | |
:host => "localhost", | |
:user => "root", | |
:password => "", | |
:database => "friendly_development" | |
class BlogPost |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserTest < ActiveSupport::TestCase | |
should "act as authenticated" do | |
module = Authlogic::ActsAsAuthentic::Login::Methods | |
User.included_modules.include?(module) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |