This file contains 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
describe UsersController do | |
describe "handling GET /users.xml" do | |
before(:each) do | |
@users = mock("Array of Users", :to_xml => "XML") | |
User.stub!(:find).and_return(@users) | |
end | |
def do_get | |
@request.env["HTTP_ACCEPT"] = "application/xml" | |
get :index |
This file contains 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
sudo ln -fs /opt/ruby-enterprise-1.8.6-20090610 /opt/ruby-enterprise | |
sudo ln -fs /opt/ruby-enterprise/bin/gem /usr/bin/gem | |
sudo ln -fs /opt/ruby-enterprise/bin/irb /usr/bin/irb | |
sudo ln -fs /opt/ruby-enterprise/bin/rake /usr/bin/rake | |
sudo ln -fs /opt/ruby-enterprise/bin/rails /usr/bin/rails | |
sudo ln -fs /opt/ruby-enterprise/bin/ruby /usr/bin/ruby |
This file contains 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
#Core Libs | |
sudo apt-get install curl tcsh git-core scons g++ | |
sudo apt-get install libpcre++-dev libboost-dev libmozjs-dev | |
#Spiderpig (Oh wait, Spidermonkey) | |
curl -O ftp://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz | |
tar zxvf js-1.7.0.tar.gz | |
cd js/src | |
export CFLAGS="-DJS_C_STRINGS_ARE_UTF8" | |
make -f Makefile.ref |
This file contains 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 | |
### BEGIN INIT INFO | |
# Provides: mongodb | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the mongodb data-store | |
# Description: starts mongodb using start-stop-daemon |
This file contains 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
script/plugin install git://github.com/purzelrakete/workling.git | |
gem sources -a http://gems.github.com/ | |
sudo gem install starling-starling | |
sudo mkdir /var/spool/starling | |
sudo ln -s /opt/ruby-enterprise/bin/starling /usr/bin/starling | |
sudo starling -d -p 22122 | |
starling -v |
This file contains 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
# Factory girl, relaxed. | |
# | |
# Factory.define :user do |f| | |
# f.login 'johndoe%d' # Sequence. | |
# f.email '%{login}@example.com' # Interpolate. | |
# f.password f.password_confirmation('foobar') # Chain. | |
# end | |
# | |
# Factory.define :post do |f| | |
# f.user { Factory :user } # Blocks, if you must. |
This file contains 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
before_create :my_cool_thing | |
def my_cool_thing | |
p Time.now | |
end |
This file contains 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
#Remove existing node.js | |
cd ~/node-previously-installed | |
./configure | |
make uninstall | |
#Installation without using sudo | |
#IIRC, this only works for shell windows opened | |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc |
This file contains 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
has_attached_file :file, | |
:styles => { :thumb => "139x107#", :thumb_ems => "64x64#", :thumb_aar => "100x100#", :thumb_newsletter => "80x60#", :thumb_newsletter_product => "110x85#", :web_image => "145x>" }, | |
:storage => :s3, | |
:bucket => "domain.com_#{RAILS_ENV}", | |
:s3_credentials => "#{RAILS_ROOT}/config/s3.yml", | |
:path => ":class/:id/:style/:filename" | |
RAILS_ENV=staging rake paperclip:refresh:thumbnails CLASS=Asset |
This file contains 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" ?> | |
<deals> | |
<deal> | |
<title>A perfect daily deal feed for just $17.50</title> | |
<link>http://www.dailydealsite/deals/1</link> | |
<guid>http://www.dailydealsite/deals/1</guid> | |
<description><![CDATA[Set your daily deal site up for maximum distribution effectiveness. Many deal sites include HTML within the description however, we recommend you remove all formatting, enabling the aggregator to more easily integrate your information. If you do include HTML, be sure wrap the description in CDATA sequences.]]></description> | |
<highlights><![CDATA[Usually a list of the deal highlights. Like the description, you should wrap the highlights in CDATA sequences.]]></highlights> | |
<image>http://www.dailydealsite.com/images/image.jpg</image> | |
<price>17.50</price> |
OlderNewer