Skip to content

Instantly share code, notes, and snippets.

🌲
lost in the woods

Tim Branyen tbranyen

🌲
lost in the woods
Block or report user

Report or block tbranyen

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
@tbranyen
tbranyen / jscs.json
Created Feb 10, 2014
My JSCS style configuration.
View jscs.json
{
"maximumLineLength": 80,
"validateJSDoc": {
"checkParamNames": true,
"checkRedundantParams": true,
"requireParamTypes": true
},
View Makefile
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.
#
View escape_delimiter.js
define(function(require, exports, module) {
"use strict";
var specialCharsExp = /[\^$\\\/.*+?()\[\]{}|]/g;
/**
* Escape special characters that may interfere with RegExp building.
*
* @param {String} value to escape.
* @return {String} safe value for RegExp building.
View couch.log
[Thu, 20 Feb 2014 01:29:54 GMT] [error] [<0.629.0>] OS Process died with status: 137
[Thu, 20 Feb 2014 01:29:54 GMT] [error] [<0.440.0>] OS Process died with status: 137
[Thu, 20 Feb 2014 01:29:54 GMT] [error] [<0.613.0>] OS Process died with status: 137
[Thu, 20 Feb 2014 01:29:57 GMT] [error] [<0.629.0>] ** Generic server <0.629.0> terminating
** Last message in was {#Port<0.3794>,{exit_status,137}}
** When Server state == {os_proc,"/usr/bin/couchjs /usr/share/couchdb/server/main.js",
#Port<0.3794>,
#Fun<couch_os_process.2.14837184>,
#Fun<couch_os_process.3.14837184>,5000}
** Reason for termination ==
View api.js
var express = require("express");
// Create the API application.
var api = express();
api.get("/v1/money", function(req, res) {
res.json({ "bling": "$$$" });
});
module.exports = api;
View jquery_usage.js
// Use an AMD package here to gain access to nested internal modules.
require.config({
packages: [{
name: "jquery",
location: "vendor/jquery/src",
main: "index.js"
}]
});
// If we are using AMD, we don't care about core.
@tbranyen
tbranyen / 01.usage.sh
Last active Aug 29, 2015
Release Script
View 01.usage.sh
./release.sh 0.1.0
@tbranyen
tbranyen / register-parallel-tasks.js
Created Mar 6, 2014
Grunt: Register Parallel Tasks
View register-parallel-tasks.js
var grunt = require("grunt");
grunt.registerParallelTasks = function(name, tasks) {
function runParallelTasks(tasks) {
tasks.forEach(function(name) {
var task = grunt.util.spawn({ args: [name], grunt: true });
task.stdout.pipe(process.stdout);
task.stderr.pipe(process.stderr);
});
@tbranyen
tbranyen / es6.js
Created Mar 9, 2014
Why ES6 has to be like this?
View es6.js
import modB from "./modB";
System.register("./modB", [], function() {
return { default: modB };
});
console.log(System.get('./modB').default);
@tbranyen
tbranyen / exports.js
Created Mar 13, 2014
CommonJS permutations.
View exports.js
// Literal value given to the module.
module.exports = {};
// Selective values being assigned.
exports.property = "value";
You can’t perform that action at this time.