Skip to content

Instantly share code, notes, and snippets.

View terinjokes's full-sized avatar

Terin Stock terinjokes

View GitHub Profile
@terinjokes
terinjokes / package.json
Last active December 21, 2015 11:38
Example of browserify.transform
{
"name": "example",
"version": "0.0.1",
"devDependencies": {
"hbsfy": "~0.1.5"
},
"browserify": {
"transform": "hbsfy"
}
}
var browserify = require('browserify'),
fs = require('fs');
var bundleStream = browserify(['./index.js']).bundle({standalone: false, debug: true});
bundleStream.pipe(fs.createWriteStream('terinjokes.js'));
>>> Installing rubinius 2.0.0 into /home/terin/.rubies/rubinius-2.0.0 ...
>>> Installing dependencies for rubinius 2.0.0 ...
Reading package lists...
Building dependency tree...
Reading state information...
automake is already the newest version.
bison is already the newest version.
flex is already the newest version.
g++ is already the newest version.
gcc is already the newest version.
>>> Installing rubinius 2.0.0 into /home/terin/.rubies/rubinius-2.0.0 ...
>>> Installing dependencies for rubinius 2.0.0 ...
Reading package lists...
Building dependency tree...
Reading state information...
automake is already the newest version.
bison is already the newest version.
flex is already the newest version.
g++ is already the newest version.
gcc is already the newest version.
@terinjokes
terinjokes / Gemfile
Last active December 25, 2015 13:39
Bundle include rubysl during gem development for Rubinius
source "https://rubygems.org"
gemspec
platforms :rbx do
gem "rubysl", "~> 2.0.0", :group => :development
end
/**
* @license
* Based on Lo-Dash 2.2.1 <http://lodash.com/>
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.5.2
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*
* Available under MIT license <http://lodash.com/license>
*/
jQuery.fn.some = function(callback) {
@terinjokes
terinjokes / multiple.jquery.js
Created October 30, 2013 20:09
Friendlier jQuery in CommonJS enivronments
(function(fn) {
function setup($) {
return $.fn.extend(fn(jQuery));
}
if (typeof exports === 'object') {
module.exports = setup;
} else {
setup(jQuery || Zepto);
}
}(function($) {
var mdeps = require('module-deps'),
JSONStream = require('JSONStream');
mdeps(__dirname + '/template.js', {
transformKey: ['browserify', 'transform']
})
.pipe(JSONStream.stringify())
.pipe(process.stdout);
@terinjokes
terinjokes / entry.js
Created January 8, 2014 23:58
[email protected] fails when someone downstream modifies the deps object
return require('util');
@terinjokes
terinjokes / string2Stream.js
Created February 10, 2014 00:20
Showing an example readable stream created from a string
var Readable = require('stream').Readable
module.exports = function string2Stream(string) {
var stream = new Readbale();
stream._read = function() {
//todo: you might want to return data based on the 'size' parameter.
stream.push(string);
string = null;
}