Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am frago12 on github.
  • I am frago12 (https://keybase.io/frago12) on keybase.
  • I have a public key ASA00XoWo5gyEN2j_Ha9GpTmYRyN6Yc3B1W0PMbUc2LAaQo

To claim this, I am signing this object:

/*
original : https://gist.github.com/BinaryMuse/2378993
Changes :
-Shares an instance of phantomJS for all requests instead of creating a new one for each
-Sends the created file as a response
-Uses good old JavaScript
-Coffee version below
*/
var phantom = require('phantom'),
/*
* Generate random lighther colors
*/
var generateColor = function( toString ) {
// to create lighter colours:
// take a random integer between 0 & 128 (rather than between 0 and 255)
// and then add 127 to make the colour lighter
var rgb = [];
rgb[0] = Math.floor((Math.random() * 128) + 1) + 127;
rgb[1] = Math.floor((Math.random() * 128) + 1) + 127;
@frago12
frago12 / jquery.ba-tinypubsub.js
Created September 28, 2011 05:14 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/*!
* jQuery Tiny Pub/Sub - v0.6 - 1/10/2011
* http://benalman.com/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($){