Skip to content

Instantly share code, notes, and snippets.

View tbranyen's full-sized avatar

Tim Branyen tbranyen

View GitHub Profile
@tbranyen
tbranyen / Makefile
Created June 3, 2014 14:30
Various ways of creating a UMD module.
all: synchronizer
#
synchronizer:
synchronizer lib/index.js > dist/out.js
@@make test
# R.js includes the `baseUrl` in the module normalization which incorrectly
# contextualizes it to the wrong location.
#
11:50 < substack> emacsen: you could do `find node_modules -name jquery -exec rm {} \;`
11:50 < substack> and just install jquery in the root node_modules
11:51 < substack> which for that particular case will probably work
11:51 < substack> jquery is one of those libraries that isn't great to have as a dependency in a module
11:52 < substack> actually -exec rm -rf {} \; because directories
11:52 < substack> that is scary looking though
11:56 < emacsen> substack, yeah, jquery isn't the issue, but I take your point
pathspec.obj : error LNK2001: unresolved external symbol "void __cdecl git_path
spec_free(struct git_pathspec *)" (?git_pathspec_free@@YAXPAUgit_pathspec@@@Z)
[C:\Users\Tim\Git\nodegit\build\nodegit.vcxproj]
C:\Users\Tim\Git\nodegit\build\Release\nodegit.node : fatal error LNK1120: 1 un
resolved externals [C:\Users\Tim\Git\nodegit\build\nodegit.vcxproj]
var self = this;
this.data = null;
(function() {
self.data = {};
})();
// vs.
@tbranyen
tbranyen / render.js
Created July 18, 2014 03:12
Combyne loop render
combyne(template).render({ items: [1,2,3] });
=> 1
2
3
// Instead of:
// Make async.
if (window.__karma__) {
window.__karma__.loaded = function() {};
}
// Set the application endpoint and load the configuration.
require.config({
paths: {
// Testing libraries.
"jasmine": "../vendor/bower/jasmine/lib/jasmine-core/jasmine",
@tbranyen
tbranyen / uri.js
Created August 25, 2014 12:27 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
define('sample', ['foo'], function ($__0) {
'use strict';
if (!$__0 || !$__0.__esModule)
$__0 = { 'default': $__0 };
var foo = $traceurRuntime.assertObject($__0).default;
var bar = foo.toUpperCase();
var $__default = bar;
return {
get default() {
return $__default;
describe('Storage', function() {
var Storage;
before(function() {
return System.import('./storage').then(function(module) {
Storage = module;
});
});
it('is an object', function() {
var transpiler = require('es6-module-transpiler');
var buildES6 = function(options) {
var container = new transpiler.Container({
resolvers: [new transpiler.FileResolver([options.path])],
formatter: new transpiler.formatters.bundle
});
container.getModule(options.module);
container.write('chrome-extension/dist/tipsy/' + options.chrome);