Skip to content

Instantly share code, notes, and snippets.

View TALlama's full-sized avatar

Seth A. Roby TALlama

View GitHub Profile
<input type='file' id='picker'>
<img style='border: 1px solid black' id='img'>
<script>
var onFilePicked = function(el, callback, opts) {
opts = opts || {}
var delayedCallback = function(url) {
setTimeout(function() {callback(url)}, 0);
}
el.onchange = el.onmouseout = function(event) {
@TALlama
TALlama / screenshot.js
Created June 19, 2012 22:07 — forked from javan/screenshot.js
Create a screenshot of any URL using phantomjs (headless webkit)
//
// Example usage: phantomjs screenshot.js http://yahoo.com /tmp/yahoo.png
//
var system = require('system');
var url = system.args[1];
var filename = system.args[2];
var page = new WebPage();
page.open(url, function (status) {