Skip to content

Instantly share code, notes, and snippets.

require 'spree_core'
require 'spree_mollie/engine'
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
Rails.configuration.cache_classes ? require(c) : load(c)
end
require 'rubygems'
gemfile = File.expand_path("../../../../Gemfile", __FILE__)
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
gem install spree
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: railties requires activesupport (= 3.1.4), actionpack (= 3.1.4); actionmailer requires actionpack (= 3.1.4); activeresource requires activesupport (= 3.1.4), activemodel (= 3.1.4); activerecord requires activesupport (= 3.1.4), activemodel (= 3.1.4)
gem install spree 38.27s user 0.30s system 71% cpu 53.572 total
@johanb
johanb / gist:2080126
Created March 18, 2012 19:35
Stream httpndownload straight to disk.
Net::HTTP.start("someurl_without_the_protocol.com") do |http|
begin
file = open("/path/to/file.mov", 'wb')
http.request_get('/' + URI.encode("file.mov")) do |response|
response.read_body do |segment|
file.write(segment)
end
end
ensure
file.close
def bieruur?
true
end
@johanb
johanb / crash.log
Created March 5, 2012 17:24
Plex crash
Process: Plex Media Server [98402]
Path: /Applications/Plex Media Server.app/Contents/MacOS/Plex Media Server
Identifier: com.plexapp.plexmediaserver
Version: 0.9.5.3 (0.9.5.3-dff0bd5)
Code Type: X86 (Native)
Parent Process: launchd [484]
Date/Time: 2012-03-05 18:14:03.700 +0100
OS Version: Mac OS X Server 10.7.3 (11D50b)
Report Version: 9
@johanb
johanb / date_time.rb
Created February 17, 2012 10:43
weekend ?
class DateTime
def weekend?
(saturday? || sunday? || (friday? && hour >= 17)) ? true : false
end
end
@johanb
johanb / Gemfile
Created January 31, 2012 14:40
Bundler fun
source "http://rubygems.org"
gem 'ruby-debug19', :platforms => :ruby_19
gem 'ruby-debug', :platforms => :ruby_18
# Specify your gem's dependencies in warden-podio.gemspec
gemspec
# POST /game_entries.json
def create
@game_entry = GameEntry.new(JSON.parse(params["entry"]))
respond_to do |format|
if @game_entry.save
format.json { render :json => { :status => true, :content => @game_entry } }
else
end
end
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript" charset="utf-8"></script>
<title>Test</title>
</head>
<body>
<p>Date: <input type="text" id="datepicker">&nbsp;<input type="text" id="alternate" size="30"/></p>
<a id="querylink" href="http://localhost:3000/?boardingtype=HP&departureairport=BRU&departuredate=2011-12-05&duration=11-16#">Blaat</a>