Skip to content

Instantly share code, notes, and snippets.

@ehoch
ehoch / gist:3189712
Created July 27, 2012 18:42
writecapture2 mutex
var mutex = false;
function load_ads()
{
if (mutex) {
setTimeout("load_ads()", 100); // try again in 100 ms?
return;
}
mutex = true;
if (!$('#pushdown').html()) {
@ehoch
ehoch / gist:1960548
Created March 2, 2012 19:17
Puma / DJ Procefile on Heroku
web: bundle exec puma -p $PORT
worker: bundle exec rake jobs:work
@ehoch
ehoch / gist:1761304
Created February 7, 2012 19:12
Spam Action on the Fly
config.actions do
member :spam do
link_icon 'icon-ban-circle'
bulkable? { true }
controller do
Proc.new do
if params[:bulk_ids]
params[:bulk_ids].each {|id| @abstract_model.model.find(id).spam }
flash[:success] = "#{params[:bulk_ids].size} Spammed"
else