Skip to content

Instantly share code, notes, and snippets.

View briancavalier's full-sized avatar

Brian Cavalier briancavalier

  • Pittsburgh
View GitHub Profile
@briancavalier
briancavalier / esnextbin.md
Created May 2, 2017 01:36 — forked from TylorS/esnextbin.md
esnextbin sketch
|====\____/====/============\=/===========|================|
|              |    ____    |/      ____//|                |
|              |   |    |   |      //_____|_____|    |_____|                    
|    |\==/|    |   |    |   |______       \\    |    |
|    | \/ |    |    \==/    |    \\/      //    |    |
|____|    |____|____________|___________//      |____|
//var PerfTime = require('perf-time');
//var _ = require('underscore');
var Perf = module.exports = function() {
this.startTime = null;
// this.t = new PerfTime();
this.t = {
get: function() {
return Date.now();
}
({
baseUrl: './src/',
dir: 'build',
include: ['main'],
logLevel: 0,
mainConfigFile: './src/main.js',
name: 'main',
wrap: false,
optimize: 'none',
preserveLicenseComments: false
var when = require('when');
var fs = require('fs');
var concat = {};
concat.each = function(src, dest, options) {
if (!options) { options = {}; }
if (!options.separator) { options.separator = ''; }
return when.reduce(src, function(output, srcpath) {
var dfd = when.defer();
@briancavalier
briancavalier / _background.md
Created November 29, 2012 13:48 — forked from unscriptable/_fast-curl-boot.md
fast ways to boot apps with curl

There are a couple of things that bug me about RequireJS's data-main method of single-script loading:

<script src="js/requirejs/require.js" data-main="app/main.js"></script>
  1. the built file (bundle) must be named "require.js". WAT.
  2. it just seems backwards.
  3. data-main does not follow w3c recommendations since it's not name-spaced.
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
@briancavalier
briancavalier / poly-hulk.js
Created June 6, 2012 19:55 — forked from scothis/gist:2884321
toHulkCase polyfill
define(function() {
String.prototype.toHulkCase = function(str) {
return 'HULK SMASH PUNY ' + str.toUpperCase() + ' ARRRRRRRRRRRRR';
}
});
@briancavalier
briancavalier / builder.js
Created March 6, 2012 12:47 — forked from pieterv/builder.js
Builder plugin for r.js to build Wire.js files
/**
* @license Copyright (c) 2010-2011 Brian Cavalier
* LICENSE: see the LICENSE.txt file. If file is missing, this file is subject
* to the MIT License at: http://www.opensource.org/licenses/mit-license.php.
*/
/**
* Builder plugin for r.js
*/
define([ 'wire/base' ], function() {
define({
plugins: [
{ module: "wire/debug" }
],
somethingFromTheParent: { $ref: 'somethingFromTheParent' }
});