Skip to content

Instantly share code, notes, and snippets.

View mholubowski's full-sized avatar

Mike Holubowski mholubowski

  • PLY Technologies
  • California
View GitHub Profile
@mholubowski
mholubowski / gist:5904945
Created July 1, 2013 21:49
prevent heroku idling
# in /tasks/scheduler.rake
desc "Called by Heroku cron add-on to stop spin down"
task :call_page => :environment do
uri = URI.parse('http://www.mikeholubowski.com/')
Net::HTTP.get(uri)
puts 'Pinged the site!'
end
# then use the heroku cron add-on to schedule it for every x minutes
@mholubowski
mholubowski / threads.rb
Last active December 18, 2015 01:29
What goes down here? Why doesn't each thread end in succession?
def print_every_3_seconds num
5.times do
puts "Thread #{num}"
sleep 3
end
puts "** DONE #{num} **"
end
(1..100).each do |num|
Thread.new do
@mholubowski
mholubowski / app JS - mike ho.co
Created November 30, 2012 06:10
Snippets of mikeho.co to show FindTheBest
function replaceProject(linkTarget) {
var area = $('#projectArea');
area.animate({right: '100%'}, 500, function() {
area.load(linkTarget + ' ' + '#projectArea');
area.animate({right: '0%'},1000, null);
urlSwap(linkTarget);
});
}