Skip to content

Instantly share code, notes, and snippets.

View rounders's full-sized avatar

Francois Harbec rounders

View GitHub Profile
@rounders
rounders / gist:1227779
Created September 19, 2011 22:26
irbrc file
#making .irbrc posted at http://www.tech-angels.fr/post/963080350/improve-irb-and-fix-it-on-mac-os-x
#work with rails3
require 'rubygems'
#rails3: be sure to include wirble and hirb in your Gemfile
require 'wirble'
require 'hirb'
Wirble.init
Wirble.colorize
# hirb (active record output format in table)
newdoorventures $ DEBUG=true ey deploy
Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Request GET https://cloud.engineyard.com/api/v2/apps
EY::API::RequestFailed 408 Request Timeout <html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Request timed out</title>
<link rel="stylesheet" href="http://assets.engineyard.com/stylesheets/master.css" type="text/css" media="screen" charset="utf-8" />
<style type="text/css">
@rounders
rounders / request.xml
Created October 6, 2011 01:07
pushing a spree adjustment to clear
<message xmlns="urn:ULGNEWCART">
<request prodID="" requestID="addToCart" description="Shipping" userID="STS" cartID="Q301-716" qty="1" cardCode="1022" siteType="CELLARS" priceEachEX="10.00" cartType="shopping" taxEach="0.00" lineNumber=""/>
</message>
<message xmlns="urn:ULGNEWCART"><request requestID="addToCart" userID="STS" cartID="Q301-740" description="Coupon (U14925568)" qty="1" cardCode="1022" siteType="CELLARS" priceEachEX="-20.00" cartType="shopping" taxEach="0.00" lineNumber="" prodID="VOUCHER"/></message>
@rounders
rounders / gist:1625808
Created January 17, 2012 09:16
problem with build_source
context "#build_source" do
let(:payment_method) { Factory(:bogus_payment_method) }
it "should build the payment's source" do
params = { :amount => 100, :payment_method_id => payment_method.id,
:source_attributes => {:year=>"2012", :month =>"1", :number => '1234567890123',:verification_value => '123'}}
payment = Spree::Payment.new(params)
payment.should be_valid
payment.source.should_not be_nil
@rounders
rounders / gist:1654849
Created January 22, 2012 00:57
testing product creation
require 'spec_helper'
def product_attributes
{
:name => "Test Product",
:description => "hello world",
:sku => "my_sku",
:price => 100,
:on_hand => 10,
:deleted_at => nil,
@rounders
rounders / gist:2962628
Created June 20, 2012 22:30 — forked from jmcnevin/gist:2558928
Installing REE with RVM, Homebrew, XCode 4.3+ on OS X Lion
# Rather than going nuclear and downgrading Xcode or using some other big GCC installer,
# this worked for me...
# From https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb
# Path may vary slightly...
export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
# If you've attempted to install REE previously and it failed...
@rounders
rounders / fancybox.js.coffee
Created September 6, 2012 01:11
load url via ajax, extract only the content you need and display in a fancybox
$('a.some_class').bind 'click', (e) ->
e.preventDefault();
$.get $(this).attr('href'), (data) ->
$.fancybox
content: $(data).find('#main_content_wrapper')
@rounders
rounders / account.coffee
Created December 9, 2015 21:41
phantomjs problem
AccountSerializer = ActiveModelSerializer.extend
attrs:
defaultPreferences:
serialize: false
subscribed:
serialize: false
cancelled:
serialize: false
defaultPreferences:
serialize: false
@rounders
rounders / deploy.rb
Created May 25, 2015 04:55
capistrano 3 compile assets locally then rsync
namespace :deploy
namespace :assets do
desc "precompile and sync assets to app servers"
task :sync do
on roles(:app), in: :parallel do |role|
run_locally do
execute "rsync -avr -e ssh ./public/assets/ #{role.username}@#{role.hostname}:#{release_path}/public/assets"
end
end
end