Skip to content

Instantly share code, notes, and snippets.

View eventualbuddha's full-sized avatar

Brian Donovan eventualbuddha

View GitHub Profile
{
"presets": ["es2015"]
}
import { nodes } from 'coffee-script';
import { createReadStream } from 'fs';
import MagicString from 'magic-string';
class LineColumnMap {
constructor(source) {
this.offsets = this.constructor.getLineOffsets(source);
}
getOffsetForLineAndColumn(line, column) {
@eventualbuddha
eventualbuddha / crust.md
Last active August 29, 2015 14:21
Gluten Free Pizza

Easy Whole Grain Pizza Crust (rice-free, xanthan gum-free, dairy-free)

  • 1 (7.5 ounce) package Chebe Bread All-Purpose Mix
  • 4 ounces (1/2 cup) millet flour, plus extra for dusting
  • 4 ounces (1/2 cup) gluten-free corn flour
  • 2 teaspoons baking powder
  • 1 cup water
  • 2 large eggs
  • 3 tablespoons olive oil
@eventualbuddha
eventualbuddha / recipe.md
Last active August 29, 2015 14:21
Gluten Free Cookies
  • 2 5/8 C brown rice flour
  • 3/4 C regular rolled oats
  • 2 t baking soda
  • 3/4 t baking powder
  • 3/4 t salt
  • 1 1/2 t xanthan gum
  • 3/8 C (3/4 stick) butter
  • 1/2 C virgin coconut oil
  • 3/8 C sugar
  • 1 1/8 C packed brown sugar
// index.js
require('babel/register')({ only: /tests/ });
require('./tests');
@eventualbuddha
eventualbuddha / rsvp.bundle.js
Last active August 29, 2015 14:12
RSVP bundled with smarter variable renaming
(function() {
function objectOrFunction(x) {
return typeof x === 'function' || (typeof x === 'object' && x !== null);
}
function isFunction(x) {
return typeof x === 'function';
}
function isMaybeThenable(x) {
@eventualbuddha
eventualbuddha / exporter.cjs.js
Last active August 29, 2015 14:10
CJS Revamp Proposal
"use strict";
exports.incr = incr;
var __esBindingListeners = [];
function __esBindingSet(name, value) {
exports[name] = value;
for (var i = 0, l = __esBindingListeners.length; i < l; i++) {
__esBindingListeners[i](name, value);
}
@eventualbuddha
eventualbuddha / rsvp.js
Created October 15, 2014 17:55
rsvp.js built with module transpiler v0.8.2
(function() {
"use strict";
function $$rsvp$events$$indexOf(callbacks, callback) {
for (var i=0, l=callbacks.length; i<l; i++) {
if (callbacks[i] === callback) { return i; }
}
return -1;
}
@eventualbuddha
eventualbuddha / -internal.js
Last active August 18, 2018 12:07
es6-promise as a gist
import {
objectOrFunction,
isFunction
} from './utils';
import asap from './asap';
function noop() {}
var PENDING = void 0;
@eventualbuddha
eventualbuddha / node-attach-test.js
Created August 28, 2014 16:49
Testing matching block comments to AST nodes
var types = require('ast-types');
var n = types.namedTypes;
var esprima = require('esprima');
function printCommentsAndNode(ast, calculatePositionOffset) {
ast.comments.forEach(function(comment) {
if (comment.type !== 'Block' || comment.value[0] !== '*') { return; }
var associatedNode = findAssociatedNodeInAstForComment(ast, comment, calculatePositionOffset);
console.log('COMMENT');