This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>debounced modify event</title> | |
| <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> | |
| <script> | |
| $.fn.debouncedModify = function (options) { | |
| if (!options) options = {}; | |
| if (!options.timeout) options.timeout = 250; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 19 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * The first commented line is your dabblet’s title | |
| */ | |
| background: #f06; | |
| background: linear-gradient(45deg, #f06, yellow); | |
| min-height: 100%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var urlmod = require('url'); | |
| var http = require('http'); | |
| var https = require('https'); | |
| var gm = require('gm'); | |
| var TIMEOUT = 10000; | |
| function identify(url, callback) { | |
| var parsed = urlmod.parse(url); | |
| var get; | |
| console.log(parsed.protocol); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Boilerplate</title> | |
| <style class="reset"> | |
| body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;} | |
| table{border-collapse:collapse;border-spacing:0;} | |
| fieldset,img{border:0;} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var | |
| express = require('express'), | |
| gm = require('gm'), | |
| http = require('http'), | |
| request = require('request'), | |
| urlmod = require('url'), | |
| app = express.createServer(); | |
| app.use(express.logger('tiny')); | |
| app.use(express.errorHandler({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var | |
| express = require('express'), | |
| gm = require('gm'), | |
| http = require('http'), | |
| request = require('request'), | |
| urlmod = require('url'), | |
| app = express.createServer(); | |
| app.use(express.logger('tiny')); | |
| app.use(express.errorHandler({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Run this, connect to | |
| http://localhost:3000/check/image?url=http://dl.dropbox.com/u/1167202/IMAG0193.jpg | |
| That image is just under 2Mb. I tell the request to disconnect immediately (see | |
| the maxSize = 0 hack inside identifyImageURL()) and all the data keeps arriving | |
| bit by bit until the entire file is downloaded. | |
| (This is perhaps more obvious on my slow South African line, but you can see | |
| the byte totals coming in and it trying to call destroy again and again in the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Person A: Can you imagine, Person B, what it must be like to argue for race based admissions policy? | |
| Person A: To live in endless screaming pain for months on end? No you cannot. | |
| Person B: hold, what you do is wrong! | |
| Person A: You have not asked properly. | |
| Person A: If you do not ask properly, we will not discuss this matter. | |
| Person A: Instead, we use the race card. | |
| Person A: oh wait | |
| Person A: you DID ask properly | |
| Person A: We will explain to you about the Nationalists and the British Colonialists | |
| Person A: the PAC, our only friends... whom we exterminated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>placehold.js</title> | |
| <script> | |
| /* | |
| Dynamically create a canvas to be used as an image placeholder. | |
| If you really want an <img>, you can use: | |
| var dataURL = canvas.toDataURL("image/png"); |