Skip to content

Instantly share code, notes, and snippets.

View sorentwo's full-sized avatar
🏡

Parker Selbert sorentwo

🏡
View GitHub Profile
# Even simpler than reaching into Paperclip, use the processing hooks:
class Project
before_post_process do |image|
false # halts processing
end
end
diff --git a/gc.c b/gc.c
--- a/gc.c
+++ b/gc.c
@@ -77,6 +77,41 @@ void *alloca ();
#ifndef GC_MALLOC_LIMIT
#define GC_MALLOC_LIMIT 8000000
#endif
+#define HEAP_MIN_SLOTS 10000
+#define FREE_MIN 4096
+
@sorentwo
sorentwo / application.rb
Created June 13, 2011 15:56
Patch devise authenticatable
# config/application.rb
module MyApp
class Application < Rails::Application
require 'devise/authenticatable'
end
end
@sorentwo
sorentwo / velge.css.sass
Created November 1, 2011 18:36
Velge markup overview
// This is the original input, we want it hidden
.velge-original {
display: none;
}
// This is the tag / input container
.velge {
// Tags list
ul {
@sorentwo
sorentwo / form_errors.js.coffee
Created January 3, 2012 18:09
Simple form error display
Backbone ||= {}
# This takes the place of the standard form / simple_form helpers in
# automatically displaying form errors when the errors have been sent back as
# json.
Backbone.form_errors = (selector, errors) ->
$form = $(selector)
clear_field = ($wrapper) ->
$wrapper.removeClass('field_with_errors')
@sorentwo
sorentwo / imagemagick_libpng_fix.sh
Created March 8, 2012 16:52 — forked from mtcmorris/lion-libpng
Fix lion libpng
# Fixing Lion libpng issues
# Until this issue https://github.com/mxcl/homebrew/issues/4468 is resolved
# installing Lion screws up ImageMagick's png support. # The following steps
# are a hacky work around to get things going again. `identify: memory
# allocation failed` is the error # message you'll receive before applying the
# fix.
brew uninstall imagemagick
cd /usr/X11R6/lib
@sorentwo
sorentwo / Gemspec
Created April 13, 2012 10:39
Sample configuration
source :gemcutter
gem 'airbrake', '~> 3.0.9'
gem 'braintree', '~> 2.14.0'
gem 'carrierwave', '~> 0.6.0.beta', git: 'git://github.com/jnicklas/carrierwave.git', ref: '789a8b952764a21e3ff837a628d8c15558cc7ad1'
gem 'dalli', '~> 1.1.5'
gem 'devise', '~> 2.0.4'
gem 'draper', '~> 0.10.0'
gem 'ejs', '~> 1.0.0'
gem 'fog', '~> 1.1.2'
@sorentwo
sorentwo / mobile_preview.haml
Created November 1, 2012 14:34
Mobile preview strategy
.mobile-preview
.mobile-screen.define-specs
-# specs markup including
.mobile-preview
.mobile-screen.write-instructions
-# specs markup including
.mobile-preview
.mobile-screen.design-mission
@sorentwo
sorentwo / multiple_endpoints.rb
Created January 31, 2013 20:17
Conflating Separate URLs
require 'faraday'
require 'json'
connection = Faraday.new
headers = { 'Content-Type' => 'application/json', 'Accepts' => 'application/json', 'Authorization' => 'token TOKEN' }
likes = connection.get do |req|
req.url 'http://localhost:3000/api/likes'
req.headers = headers
end
@sorentwo
sorentwo / aws_comparison.md
Created February 4, 2013 15:43
Comparison of fog and aws concerning LOC, load time, and dependencies. All measurements are against /lib, not counting features, specs or tests.
Library Disk Space Lines of Code Boot Time Runtime Deps Develop Deps
fog 28.0M 133469 0.693 9 11
aws-sdk 4.4M 80017 0.098 3 8