This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
var myConfObj = { | |
iframeMouseOver : false | |
} | |
window.addEventListener('blur',function(){ | |
if(myConfObj.iframeMouseOver){ | |
console.log('Wow! Iframe Click!'); | |
} | |
}); | |
document.getElementById('YOUR_CONTAINER_ID').addEventListener('mouseover',function(){ |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
SUMMARIZED / REFORMATTED FROM http://www.opendataphilly.org/opendata/resource/158/sms-transit/
Base URL: http://www3.septa.org/sms/
Parameters:
require 'json' | |
require 'base64' | |
require 'exifr' | |
def to_decimal(dms) | |
dms[0].to_f + dms[1].to_f / 60 + dms[2].to_f / 3600 | |
end | |
def to_geojson(exif) | |
lat_exif = exif.gps_latitude |
// Usage: http://localhost:8080/image.jpg/100x50 | |
var http = require('http'); | |
var spawn = require('child_process').spawn; | |
http.createServer(function(req, res) { | |
var params = req.url.split('/'); | |
var convert = spawn('convert', [params[1], '-resize', params[2], '-']); | |
res.writeHead(200, {'Content-Type': 'image/jpeg'}); | |
convert.stdout.pipe(res); |
# I'm currently using Devise along with Resque's resque-web UI. I have resque-web running | |
# as an embedded rack application inside of my main Rails app with the following line in my | |
# my routes.rb file: | |
# | |
# mount Resque::Server.new, :at => "/resque" | |
# | |
# This makes resque-web expect its static assets to be found in your site's /public/resque | |
# folder, where they won't be. | |
# | |
# The answer is to copy or symlink to those assets which are found in the gem's own public |