Skip to content

Instantly share code, notes, and snippets.

View anlek's full-sized avatar
💬
Writing code...

Andrew Kalek anlek

💬
Writing code...
View GitHub Profile
@anlek
anlek / Gemfile.lock
Created April 3, 2012 11:45
Issue: NoMethodError (undefined method `status=' for #<xxxController:0x10b689a50>):
GIT
remote: git://github.com/bigbinary/active_record_no_table.git
revision: c293cf2f3bb3f9bd0b4f69229883fa02041cce49
specs:
active_record_no_table (0.0.5)
GEM
remote: http://rubygems.org/
specs:
RedCloth (4.2.9)
@anlek
anlek / wicked_pdf.rb
Created February 14, 2012 18:46 — forked from simmogs/wicked_pdf.rb
Using Wicked_PDF with Rails 3.1
#in config/initializers/wicked_pdf.rb
module WickedPdfHelper
def wicked_pdf_stylesheet_link_tag(*sources)
sources.collect { |source|
"<style type='text/css'>#{Rails.application.assets.find_asset("#{source}.css")}</style>"
}.join("\n").gsub(/url\(['"](.+)['"]\)(.+)/,%[url("#{wicked_pdf_image_location("\\1")}")\\2]).html_safe
end
def wicked_pdf_image_tag(img, options={})
image_tag wicked_pdf_image_location(img), options
@anlek
anlek / console1.log
Created February 6, 2012 16:15
Issue faced when trying to run devise and active_reload
#Output when I added the require ORM statement to config/devise.rb
~/projectx/vendor/ruby/1.9.1/gems/devise-2.0.0/lib/devise/rails/routes.rb:391:in `raise_no_devise_method_error!': User does not respond to 'devise' method. This usually means you haven't loaded your ORM file or it's being loaded too late. To fix it, be sure to require 'devise/orm/YOUR_ORM' inside 'config/initializers/devise.rb' or before your application definition in 'config/application.rb' (RuntimeError)
from ~/projectx/vendor/ruby/1.9.1/gems/devise-2.0.0/lib/devise/rails/routes.rb:197:in `block in devise_for'
from ~/projectx/vendor/ruby/1.9.1/gems/devise-2.0.0/lib/devise/rails/routes.rb:193:in `each'
from ~/projectx/vendor/ruby/1.9.1/gems/devise-2.0.0/lib/devise/rails/routes.rb:193:in `devise_for'
from ~/projectx/config/routes.rb:24:in `block in <top (required)>'
from ~/projectx/vendor/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/routing/route_set.rb:272:in `instance_exec'
from ~/projectx/vendor/ruby/1.9.1/gems/actionpack-3.2.
@anlek
anlek / Gemfile.lock
Created November 1, 2011 23:15
Draper Issue
GIT
remote: git://github.com/chriseppstein/compass.git
revision: 3a4c5c75dca9f07f6edf2f0898a4626269e0ed62
specs:
compass (0.12.alpha.0.3a4c5c7)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
GIT
> gem install ghoul
Fetching: rack-1.3.5.gem (100%)
Fetching: rack-protection-1.1.4.gem (100%)
Fetching: tilt-1.3.3.gem (100%)
Fetching: sinatra-1.3.1.gem (100%)
Fetching: sass-3.1.10.gem (100%)
Fetching: grit-2.4.1.gem (100%)
Fetching: georgedrummond_sinatra_helpers-0.0.7.gem (100%)
Fetching: ghoul_grack-0.0.1.gem (100%)
Fetching: coderay-1.0.3.gem (100%)
@anlek
anlek / Gemfile
Created October 25, 2011 21:44
My Setup
source 'http://rubygems.org'
gem 'rails', '>= 3.1.0'
gem 'activemerchant', :git => "git://github.com/quadule/active_merchant.git"
#gem 'exact4r', '>= 1.4'
#Rails enhancements
gem "responders"
gem 'inherited_resources', '~> 1.2.1'
@anlek
anlek / wicked_pdf.rb
Created September 14, 2011 23:54
Using Wicked_PDF with Rails 3.1
#in config/initializers/wicked_pdf.rb
module WickedPdfHelper
def wicked_pdf_stylesheet_link_tag(*sources)
sources.collect { |source|
"<style type='text/css'>#{Rails.application.assets.find_asset("#{source}.css").body}</style>"
}.join("\n").gsub(/url\(['"](.+)['"]\)(.+)/,%[url("#{wicked_pdf_image_location("\\1")}")\\2]).html_safe
end
def wicked_pdf_image_tag(img, options={})
image_tag wicked_pdf_image_location(img), options
@anlek
anlek / gist:1207819
Created September 10, 2011 01:54
Issue with Rails-footnotes gem
Started GET "/background_jobs" for 127.0.0.1 at Fri Sep 09 17:42:03 -0800 2011
[Barista] Compiling all scripts for barista
[Barista] Compiling all coffeescripts
[Barista] Copying all javascripts
Processing by BackgroundJobsController#index as HTML
Rendered background_jobs/_background_job.html.slim (8.6ms)
Rendered shared/_navigation.html.slim (3.5ms)
Rendered background_jobs/index.html.slim within layouts/application (178.6ms)
Footnotes Footnotes::Notes::ParamsNote Exception: undefined method `symbolize_keys!' for {"action"=>"index", "controller"=>"background_jobs"}:ActiveSupport::HashWithIndifferentAccess
/Users/andrew/code/rails_apps/dealnation/vendor/ruby/1.8/gems/activesupport-3.0.10/lib/active_support/core_ext/hash/keys.rb:18:in `symbolize_keys'
@anlek
anlek / example.rb
Created August 22, 2011 21:10
Issue I'm having with Pry and Mongoid when looking at relationships
u = User.first
u.articles
[["~>", #<Gem::Version "2.5.0">]]
[2, 5, 0]
">="
4194298
#<Gem::Version "0">
3
[[">=", #<Gem::Version "0">]]
[0]
">="
4194298