Skip to content

Instantly share code, notes, and snippets.

View thomasboyt's full-sized avatar

Thomas Boyt thomasboyt

View GitHub Profile
@thomasboyt
thomasboyt / requirejs_grunt_config.js
Created January 31, 2014 18:54
requirejs sadness
var _ = require('underscore');
var baseConfig = {
baseUrl: 'public/',
name: 'js/lib/requirejs/require',
mainConfigFile: 'public/js/main.js',
wrap: true,
// Configuration for jsx plugin to work
useStrict: true,
@thomasboyt
thomasboyt / optimum.md
Last active August 29, 2015 13:56
My Optimum nightmare

Background: after my internet was installed back in July, it had been a bit spotty, but nothing out of the ordinary, up until January, when it became a complete trainwreck. I prodded Optimum Support on Twitter to get me appointments, since their phone system is a nightmare.

Appointment 1

Jan 10:

Me: Hi, my home internet connection has been completely down for the past few days and I was told to send my account info here

Me: Not sure exactly what I need to send - it's registered under "Thomas Boyt," number XXX-XXX-XXXX, zip code XXXX >

@thomasboyt
thomasboyt / grunt.js
Created February 10, 2014 23:44
Side-by-side comparison of Grunt and Gulp configuration. Only significant difference is that `gulp-concat` doesn't generate source maps like `grunt-concat-sourcemaps`.
/* jshint node: true */
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
transpile: {
main: {
type: 'amd',
moduleName: function(path) {

Let's say I have a Bower package called my-less. It depends on a LESS package called lesshat.

my-less's structre is this:

my-less/
  bower_components/   <- not checked in
    lesshat/
      lesshat.less
 main.less
/**
* A restartable promise chain using q (tho it could be adapted for other libs).
*
* Usage:
* var chain = new RestartableChain([firstFn, secondFn, thirdFn...]);
*
* chain.execute() - run chain, returning a promise that is resolved if all promises
* in the chain resolve, otherwise rejects at first rejection.
*
* If the chain has been previously run & errored, this method will restart from the
@thomasboyt
thomasboyt / transpile.js
Last active August 29, 2015 13:56
static analysis required for transpiler++
// a.js
export var a = 3;
// b.js
import { a } from "a";
console.log(a); // 3
// a.js
"use strict";
var __es6_module__ = {}, __imports__ = [];
module.exports = {
__es6_module__: __es6_module__
};
__imports__['./b'] = require('./b');
import odd from './b';
export default function even(n) {
// below should be rewritten...
return n === 0 || odd(n - 1);
}
// below should not
function foo(odd) {
odd = 1;

Keybase proof

I hereby claim:

  • I am thomasboyt on github.
  • I am tboyt (https://keybase.io/tboyt) on keybase.
  • I have a public key whose fingerprint is 5871 E161 AACE 33CB 8358 9C90 CD7D 9921 816C 5C3B

To claim this, I am signing this object:

"use strict";
var __es6_module__ = {}, __imports__ = [];
module.exports = {
__es6_module__: __es6_module__
};
__imports__['./b'] = require('./b');
__imports__['./b'] = __imports__['./b'].__es6_module__ || __imports__['./b'];