Skip to content

Instantly share code, notes, and snippets.

@rknLA
rknLA / gist:1809030
Created February 12, 2012 15:19
heroku logs
2012-02-14T20:44:03+00:00 heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 8894`
2012-02-14T20:44:05+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/do_postgres-0.10.8/lib/do_postgres.rb:26:in `<top (required)>'
2012-02-14T20:44:05+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/do_postgres-0.10.8/lib/do_postgres.rb:26:in `require': no such file to load -- do_postgres/do_postgres (LoadError)
2012-02-14T20:44:05+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/dm-postgres-adapter-1.2.0/lib/dm-postgres-adapter/adapter.rb:1:in `<top (required)>'
2012-02-14T20:44:05+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/dm-postgres-adapter-1.2.0/lib/dm-postgres-adapter/adapter.rb:1:in `require'
2012-02-14T20:44:05+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/dm-postgres-adapter-1.2.0/lib/dm-postgres-adapter.rb:1:in `require'
2012-02-14T20:44:05+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/dm-postgres-adapter-1.2.0/lib/dm-postgr
@rknLA
rknLA / routes.rb
Created February 27, 2012 08:19
options?
match '/' => 'api/application#index', :constraints => {:method => 'GET'}
match '/' => 'api/application#options', :constraints => {:method => 'OPTIONS'}
@rknLA
rknLA / gist:1955344
Created March 2, 2012 03:28 — forked from jipiboily/gist:1955326
How to apply an override with Deface
# Step 1: you need to add the files in say "app/overrides", ie: "/app/overrides/insert_this_here.rb"
# Step 2: add that in your application.rb to load them (and decorators)
config.to_prepare do
# Load application's model / class decorators (optional for Deface, but you should have it in your app if you use Spree AFAIK.
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
Rails.configuration.cache_classes ? require(c) : load(c)
end
# Load application's view overrides
Dir.glob(File.join(File.dirname(__FILE__), "../app/overrides/*.rb")) do |c|
@rknLA
rknLA / create_sellers.rb
Created March 30, 2012 00:44
table naming
class CreateSellers < ActiveRecord::Migration
def change
create_table :sellers do |t|
t.integer :manager_id
t.integer :address_id
t.timestamps
end
end
end
@rknLA
rknLA / admin.html.haml
Created April 4, 2012 20:35
capybara error?
-# app/views/layouts/admin.html.haml
!!! 5
%html{:lang => "en"}
%head
%meta{:charset => "utf-8"}/
%title= content_for?(:title) ? yield(:title) : "HammerSoundscapeServer"
= csrf_meta_tags
/ Le HTML5 shim, for IE6-8 support of HTML elements
/[if lt IE 9]
@rknLA
rknLA / gist:2375530
Created April 13, 2012 10:04
post results
☺ curl -v -F '[email protected]' http://curiousjoshbooth.com/process_post.php -X POST ruby-1.9.2-p290 kevin bd6e028
* About to connect() to curiousjoshbooth.com port 80 (#0)
* Trying 50.63.77.1... connected
* Connected to curiousjoshbooth.com (50.63.77.1) port 80 (#0)
> POST /process_post.php HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: curiousjoshbooth.com
> Accept: */*
> Content-Length: 53619
> Expect: 100-continue
joshs-computer:CuriousJosh-Kiosk josh$ git push heroku master
The authenticity of host 'heroku.com (50.19.85.156)' can't be established.
RSA key fingerprint is 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'heroku.com,50.19.85.156' (RSA) to the list of known hosts.
Counting objects: 1111, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (922/922), done.
Writing objects: 100% (1111/1111), 16.09 MiB | 117 KiB/s, done.
@rknLA
rknLA / gist:2376664
Created April 13, 2012 12:42
upload error.
☺ curl -v -F '[email protected]' -F 'key=78665d0408acc5ebdd89327b3f92d51a' http://curiousjoshbooth.com/process_post.php -X POST ruby-1.9.2-p290 master 2ef119a
* About to connect() to curiousjoshbooth.com port 80 (#0)
* Trying 50.63.77.1... connected
* Connected to curiousjoshbooth.com (50.63.77.1) port 80 (#0)
> POST /process_post.php HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: curiousjoshbooth.com
> Accept: */*
> Content-Length: 53743
> Expect: 100-continue
resources :microposts do
member do
post 'retweet'
end
end
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
tabViewController = [storyboard instantiateInitialViewController];
[self.window addSubview:[tabViewController view]];