Skip to content

Instantly share code, notes, and snippets.

@jaydson
jaydson / gist:1780598
Created February 9, 2012 15:11
How to detect a click event on a cross domain iframe
var myConfObj = {
iframeMouseOver : false
}
window.addEventListener('blur',function(){
if(myConfObj.iframeMouseOver){
console.log('Wow! Iframe Click!');
}
});
document.getElementById('YOUR_CONTAINER_ID').addEventListener('mouseover',function(){
@jasonrudolph
jasonrudolph / about.md
Last active January 6, 2024 07:40
Programming Achievements: How to Level Up as a Developer
@mheadd
mheadd / septa.md
Created June 23, 2011 16:52
SEPTA Bus / Train API info
@max-mapper
max-mapper / exif-extract.rb
Created June 20, 2011 21:06
grab exif data from jpgs and emit geojson coordinates using ruby
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
@felixge
felixge / image_resize.js
Created May 20, 2011 18:07
On demand image resizing with node.js in
// 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);
@jmcnevin
jmcnevin / deploy.rb
Created March 24, 2011 19:04
Rails 3, Devise, Resque, Capistrano, and static resque-web assets
# 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