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
# Filename: RAILS_ROOT/lib/paperclip_processors/thumbnail_with_dimensions.rb | |
# Required Configuration in the model | |
# has_attached_file :image, | |
# :styles => { | |
# :thumbnail => { | |
# :geometry => "100x100>", | |
# :format => :png, | |
# :processors => [:thumbnail_with_dimensions], | |
# :mystyle => :thumbnail | |
# }, |
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
#!/usr/bin/ruby | |
#url labels can only be /a-zA-Z0-9-/ | |
urls = [ | |
['Spreedemo-home', 'http://demo.spreecommerce.com/'], | |
['Spreedemo-product', 'http://demo.spreecommerce.com/products/xm-inno-xm2go-portable-satellite-radio-mp3-player-and-home-kit'], | |
['Google-home', 'http://www.google.com/'], | |
['Google-shopping', 'http://www.google.com/prdhp?hl=en&tab=vf'] | |
] | |
n = 100 |
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
# control mplayer remotely via rack | |
# | |
# load & append files (mp3, ogg, etc) & lists (m3u) | |
# http://localhost:3000/mplayer/loadfile+http://www.archive.org/download/af002/03_Swiss_Jazz.mp3 | |
# http://localhost:3000/mplayer/loadlist+http://www.archive.org/stream/af002 | |
# | |
# playback | |
# http://localhost:3000/mplayer/pause | |
# http://localhost:3000/mplayer/stop | |
# |
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
Order.class_eval do | |
state_machine :initial => :cart, :use_transactions => false do | |
event :next do | |
transition :from => 'cart', :to => 'orderdetails' | |
transition :from => 'orderdetails', :to => 'address' | |
transition :from => 'address', :to => 'delivery' | |
transition :from => 'delivery', :to => 'payment', :if => :payment_required? | |
transition :from => 'delivery', :to => 'complete' | |
transition :from => 'confirm', :to => 'complete' |
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
#!/usr/bin/env zsh | |
# 1304046900 TRACKS CHANGES TO PARTS OF SPREE SINCE A GIVEN BRANCH | |
old_branch_or_commit="29e3d4f707bdb047a6fabc2543247139027b06fb" | |
parts=( | |
config/locales/en.yml | |
core/app/views | |
) |
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
#!/usr/bin/env zsh | |
# 1304046900 TRACKS CHANGES TO RAILS' APP SKELETON SINCE A GIVEN VERSION | |
old_version="3.1.1" | |
# Exit on failure | |
# | |
set -e |
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 | |
## you'll have to do a couple extra steps to get this running | |
## there are probably other ways to handle svncanboot, but this is from the linux forum | |
set -e | |
if | |
touch /etc/_testr_file | |
then |
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
module Spree | |
class Calculator::Bogo < Calculator | |
preference :number_to_buy, :integer, :default => 1 | |
preference :number_to_get, :integer, :default => 1 | |
def self.description | |
"Buy One Get One" | |
end | |
def compute(order) |
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
#!/usr/bin/env zsh | |
# 1304046900 TRACKS CHANGES TO PARTS OF SPREE SINCE A GIVEN COMMIT | |
# To be placed in the root of your app. | |
old_commit="32483802d823e92c0746d080217870dd48f49307" | |
parts=( | |
core/app/assets/javascripts/store/checkout.js |
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
#!/usr/bin/env zsh | |
# 1304046900 TRACKS CHANGES TO RAILS' APP SKELETON SINCE A GIVEN VERSION | |
# To be placed in the root of your app. | |
old_version="3.1.3" | |
# Exit on failure | |
# |
OlderNewer