Skip to content

Instantly share code, notes, and snippets.

View Kris-Simpson's full-sized avatar

Serhii Vitko Kris-Simpson

View GitHub Profile

error info:

➜  hh (develop-hh) ✔ gem install libv8 -v '3.16.14.11'
Building native extensions.  This could take a while...
ERROR:  Error installing libv8:
	ERROR: Failed to build gem native extension.

    current directory: /Users/simonqian/.rvm/gems/ruby-2.2.2/gems/libv8-3.16.14.11/ext/libv8
/Users/simonqian/.rvm/rubies/ruby-2.2.2/bin/ruby -r ./siteconf20170410-48026-19k49a7.rb extconf.rb
creating Makefile
@sgringwe
sgringwe / rails4_paperclip_default_url
Last active March 19, 2019 00:54
rails 4 paperclip asset_path precompiled default_url
I was having trouble setting the default_url for paperclip attachables while using rails 4 asset pipeline fingerprints.
What was not working for some reason:
default_url: ActionController::Base.helpers.asset_path('event_default.jpg')
What worked for me:
default_url: lambda { |image| ActionController::Base.helpers.asset_path('event_default.jpg') }
@christianroman
christianroman / blur.rb
Created October 11, 2013 18:33
Blurring images in Rails with Paperclip custom processor
module Paperclip
class Blur < Processor
def initialize file, options = {}, attachment = nil
super
@format = File.extname(@file.path)
@basename = File.basename(@file.path, @format)
end