Skip to content

Instantly share code, notes, and snippets.

View curtis's full-sized avatar

Curtis Miller curtis

View GitHub Profile
@curtis
curtis / imagemagick-heroku-after.txt
Last active September 21, 2021 15:55
Imagemagick limits after setting Heroku config
$ heroku config:set MAGICK_MAP_LIMIT=32MiB
Setting MAGICK_MAP_LIMIT and restarting ⬢ radiant-waters-37422... done, v46
MAGICK_MAP_LIMIT: 32MiB
$ heroku config:set MAGICK_MEMORY_LIMIT=16MiB
Setting MAGICK_MEMORY_LIMIT and restarting ⬢ radiant-waters-37422... done, v47
MAGICK_MEMORY_LIMIT: 16MiB
$ heroku run identify -list resource
Running identify -list resource on ⬢ radiant-waters-37422... up, run.5905 (Hobby)
@curtis
curtis / imagemagick-heroku-before.txt
Last active July 12, 2018 20:20
Imagemagick limits on Heroku
$ heroku run identify -list resource
Running identify -list resource on ⬢ radiant-waters-37422... up, run.6306 (Hobby)
File Area Memory Map Disk Thread Throttle Time
--------------------------------------------------------------------------------
7500 128.85GB 60GiB 120GiB unlimited 8 0 unlimited
@curtis
curtis / activerecord_patch.rb
Created May 20, 2015 18:22
Initializer file to help patch Rails 3.2.* has_many associations when using Ruby 2.2. See https://github.com/rails/rails/issues/18991
# For Rails 3.2.*
#
if Rails.version =~ /^3.2/
# The call to has_cached_counter? throws an exception on the 3.2.* version of rails.
# See https://github.com/rails/rails/issues/18991
ActiveRecord::Associations::HasManyThroughAssociation.class_eval do
def size
if has_cached_counter?(reflection)
owner.send(:read_attribute, cached_counter_attribute_name)
elsif loaded?
@curtis
curtis / gist:4628e0a48be7b7c38b73
Created August 14, 2014 20:14
Sample local PostgreSQL database.yml file
defaults: &defaults
adapter: postgresql
host: localhost
encoding: unicode
pool: 5
username: USERNAME
password:
template: template0
development: &dev
@curtis
curtis / make element sortable
Created June 29, 2011 21:06
Mongoid sortable
$(document).ready(function() {
$('table.tracks tbody').makeSortable({ url: "<%= sort_my_mix_tracks_path(mix) -%>" });
});
@curtis
curtis / gist:437016
Created June 13, 2010 21:19
Setting the innerHTML to a non-URL and href attribute to a URL using JavaScript
var link = createElement('a');
link.innerHTML = "This is not a URL";
link.href = "http://flatterline.com";
@curtis
curtis / gist:437011
Created June 13, 2010 21:12
Setting the inner HTML and href attribute of an anchor tag using JavaScript
var link = document.createElement('a');
link.innerHTML = "http://flatterli...";
link.href = "http://flatterline.com";
@curtis
curtis / gist:436998
Created June 13, 2010 21:03
Setting the href attribute of an anchor tag using JavaScript
var link = document.createElement('a');
link.href = "http://flatterline.com";
sudo gem uninstall rack (answer yes to remove dependencies and continue with uninstall)
mkdir ~/sources
cd ~/sources
git clone git://github.com/rack/rack.git
cd rack
sudo rake gem VERSION=1.0.0
sudo gem install rack-1.0.0.gem
/!\ FAILSAFE /!\ 09/29/09 03:21
Status: 500 Internal Server Error
invalid byte sequence in US-ASCII