Skip to content

Instantly share code, notes, and snippets.

Brian Cavalier briancavalier

Block or report user

Report or block briancavalier

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View most-logo-2.md
|====\____/====/============\=/===========|================|
|              |    ____    |/      ____//|                |
|              |   |    |   |      //_____|_____|    |_____|                    
|    |\==/|    |   |    |   |______       \\    |    |
|    | \/ |    |    \==/    |    \\/      //    |    |
|____|    |____|____________|___________//      |____|
View perf.js
//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();
}
View buildConfig.js
({
baseUrl: './src/',
dir: 'build',
include: ['main'],
logLevel: 0,
mainConfigFile: './src/main.js',
name: 'main',
wrap: false,
optimize: 'none',
preserveLicenseComments: false
View concat-promises.js
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 Nov 29, 2012 — forked from unscriptable/_fast-curl-boot.md
fast ways to boot apps with curl
View _background.md

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.
View mq.css
@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 Jun 6, 2012 — forked from scothis/gist:2884321
toHulkCase polyfill
View poly-hulk.js
define(function() {
String.prototype.toHulkCase = function(str) {
return 'HULK SMASH PUNY ' + str.toUpperCase() + ' ARRRRRRRRRRRRR';
}
});
@briancavalier
briancavalier / builder.js
Created Mar 6, 2012 — forked from pieterv/builder.js
Builder plugin for r.js to build Wire.js files
View builder.js
/**
* @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() {
View app.spec.js
define({
plugins: [
{ module: "wire/debug" }
],
somethingFromTheParent: { $ref: 'somethingFromTheParent' }
});
You can’t perform that action at this time.