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
##In test file | |
#setup do | |
# load_scenario("bookshop_a") | |
#end | |
# | |
#test "Franks has 5 books" do | |
# assert_equal 5, @frank.books.count | |
#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
before "deploy:rollback:revision", "thinking_sphinx:stop_gracefully" | |
after "deploy:default", "thinking_sphinx:symlink" | |
after "deploy:default", "thinking_sphinx:ready" | |
namespace :thinking_sphinx do | |
task :stop_gracefully do | |
begin | |
thinking_sphinx.stop | |
rescue | |
puts "ThinkingSphinx is not running. No stop required." |
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 type="text/javascript"> | |
google.load("jquery", "1.3.2"); | |
</script> | |
<script type="text/javascript"> | |
function show_last_track(JSONdata) { | |
var last_track = JSONdata.recenttracks.track; | |
var track_artist = last_track.artist['#text']; | |
var track_name = last_track.name; | |
var track = track_artist + " - " + track_name; |
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
# Make port 80 "real life" speeds | |
# You can also use Mongrel ports. | |
function slow_port { | |
# Set the port variable if no port inputted. Defaulted to 80 (for Passenger). | |
if [ -z "$1" ] | |
then port=80 | |
else port=$1 | |
fi | |
# Slow the ports. |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> | |
<head> | |
<title>Livestream API for web developers - example</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | |
<script type="text/javascript" src="swfobject.js"></script> | |
<script type="text/javascript"> | |
flashvars = { channel: 'mogulusbackstage' }; | |
params = { AllowScriptAccess: 'always' }; |
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
ul | |
list-style-type: none | |
li | |
float: left |
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
## Listing | |
has_one :residential | |
delegate :room_desc | |
## Listing::Residential | |
## Console | |
>> listing.room_desc = "This is a room" | |
=> "This is a room" |
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
>> a | |
=> ["joe", "pass"] | |
>> h = {} | |
=> {} | |
>> a.each_with_index do |b, i| | |
?> h[i] = b | |
>> end | |
=> ["joe", "pass"] | |
>> h | |
=> {0=>"joe", 1=>"pass"} |
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
## code | |
def listing_file=(file) | |
# self.listing_files.build.attachment = file | |
self.listing_files.create :attachment => file | |
self.listing_files.build(:attachment => file) | |
raise " | |
#{file} | |
---- |
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
<% form_for :listing, @listing, :url => listing_path(@listing), :html => { :method => :put, :class => "edit_post", :id => "edit_post_45" } do |f| %> | |
## method is still not put as described in the api. |