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
# Template created by You've Got Rails (http://www.youvegotrails.com) | |
# Remove unnecessary Rails files | |
run 'rm README' | |
run 'rm public/index.html' | |
run 'rm public/favicon.ico' | |
run 'rm public/images/rails.png' | |
# Remove Prototype files |
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
class GalleryImagesController < ApplicationController | |
def rotate | |
@image = GalleryImage.find(params[:id]) | |
rotation = params[:deg].to_f | |
rotation ||= 90 # Optional, otherwise, check for nil! | |
@image.rotate!(rotation) | |
flash[:notice] = "The image has been rotated" | |
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
>> x = HelpFile.create(:title => "Test help file", :content => "Hello world!", :is_published => true, :publish_date => Time.now.utc) | |
=> #<HelpFile _id: test-help-file, title: Test help file, excerpt: Hello world!..., is_published: true, content: Hello world!, publish_date: 28/02/2010> | |
>> x.publish_date | |
ArgumentError: invalid date | |
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/date.rb:1573:in `new_by_frags' | |
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/date.rb:1618:in `parse' | |
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/active_support/values/time_zone.rb:246:in `parse' | |
from /Library/Ruby/Gems/1.8/gems/mongoid-0.10.6/lib/mongoid/extensions/time/conversions.rb:12:in `get' | |
from /Library/Ruby/Gems/1.8/gems/mongoid-0.10.6/lib/mongoid/field.rb:35:in `get' | |
from /Library/Ruby/Gems/1.8/gems/mongoid-0.10.6/lib/mongoid/attributes.rb:32:in `read_attribute' |
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
require 'rubygems' | |
require 'active_support' | |
require 'active_support/core_ext' | |
require 'ohm' | |
require 'mongo_mapper' | |
require 'benchmark' | |
require 'dm-core' | |
require 'model1' | |
require 'model2' | |
require 'model3' |
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
development: | |
access_key_id: YOUR-KEY-ID | |
secret_access_key: YOUR-SECRET-KEY | |
test: | |
access_key_id: | |
secret_access_key: | |
production: | |
access_key_id: YOUR-KEY-ID |
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
(function($) { | |
$.fn.fabtabs = function() { | |
var target = $(this); | |
this.fabtab.init(target); | |
return this; | |
}; | |
// Some local storage.. | |
$.fn.fabtab = { |
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
/* | |
* Fabtabulous! Simple tabs using Prototype | |
* http://tetlaw.id.au/view/blog/fabtabulous-simple-tabs-using-prototype/ | |
* Andrew Tetlaw | |
* version 1.1 2006-05-06 | |
* http://creativecommons.org/licenses/by-sa/2.5/ | |
* | |
* Note: getInitialTab() method modified for Swellnet | |
*/ | |
var Fabtabs = Class.create(); |
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
var app = { | |
featureTimeoutHandle: -1, | |
setupUserDialog: function() { | |
jQuery(".user_placeholder").load("/members/current.js?r=" + location.href); | |
jQuery("a#signin_link").live("click", function(e) { | |
e.preventDefault(); | |
e.stopPropagation(); | |
jQuery("#login_dialog").fadeIn(); | |
}); |
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
[Broc-MBP.local]: Broc:~/.bin [git:master!] | |
→ cd /tmp | |
[Broc-MBP.local]: Broc:/tmp | |
→ git clone http://github.com/jnunemaker/mongomapper.git | |
Initialized empty Git repository in /private/tmp/mongomapper/.git/ | |
mviremote: Counting objects: 6667, done. | |
remote: Compressing objects: 100% (2387/2387), done. | |
Receiving objects: 27% (1801/6667), 316.00 KiB | 97 KiB/s | |
remote: Total 6667 (delta 4737), reused 6014 (delta 4193) |
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
require 'httparty' | |
require 'json' | |
WHEEL_URL = "http://roulette.engineyard.com" | |
LUCKY_NUMBER = 13 #or not so lucky | |
PAYOUT_FACTOR = 35 | |
def spin_the_wheel(bet) | |
spin = HTTParty.get(WHEEL_URL) | |
OlderNewer