Skip to content

Instantly share code, notes, and snippets.

View scosman's full-sized avatar
⌨️

Steve Cosman scosman

⌨️
View GitHub Profile
helloworld
@scosman
scosman / dash.html
Created August 30, 2012 13:50
Kobo stats
<html>
<head>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script type='text/javascript'>
$(function()
{
$('#goBtn').click(function()
{
getStats();
setInterval(getStats, 300000); // 5 mins
@scosman
scosman / gist:2499922
Created April 26, 2012 14:22
Threaded delayed_job
# Threaded delayed_job. Useful for Heroku where each process/dyno costs money.
# run "rake jobs:threaded_work[4]" to start 4 worker threads
namespace :jobs do
desc "Start several delayed_job workers."
task :threaded_work, [:num_workers] => :environment do |t,args|
args.with_defaults(:num_workers => 1)
threads = []
workers = []
workersSemaphore = Mutex.new