Skip to content

Instantly share code, notes, and snippets.

TJ Holowaychuk tj

Block or report user

Report or block tj

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 input.go
// grab time spent
sum := Agg("duration_sum", Sum("duration"))
// grab time spent per label
labels := Agg("labels",
Terms("issue.labels.keyword", 100),
// grab time spent per day, and per label
View asya
...e$e.$...e$ ...e$e.$...e
!$6lkasd!$6lkasd!$6l !$6lkasd!$6lkasd!
;,a1wert;,a1wert;,a1wert ;,a1wert;,a1wert;,a1we .asxzcvb.asxzcvb.asxzcvb.
View haml.js
/* ex:ts=2:et: */
/*jslint bitwise: true, browser: true, eqeqeq: true, evil: true, immed: true, newcap: true,
nomen: true, plusplus: true, regexp: true, undef: true, white: true, indent: 2 */
/*globals */
var Haml = {};
// Bind to the exports object if it exists. (CommonJS and NodeJS)
if (exports) {
Haml = exports;
View batch.js
* Expose `Batch`.
module.exports = Batch;
* Create a new Batch.
View css.js
* Module dependencies.
var fs = require('fs');
var css = fs.readFileSync('style.css', 'utf8');
function scan(buf) {
View bind.js
function FunctionBind(this_arg) { // Length is 1.
if (!IS_FUNCTION(this)) {
throw new $TypeError('Bind must be called on a function');
// this_arg is not an argument that should be bound.
var argc_bound = (%_ArgumentsLength() || 1) - 1;
if (argc_bound > 0) {
var bound_args = new $Array(argc_bound);
for(var i = 0; i < argc_bound; i++) {
bound_args[i] = %_Arguments(i+1);
View foo.js
function InstantiateFunction(data, name) {
// We need a reference to kApiFunctionCache in the stack frame
// if we need to bail out from a stack overflow.
var cache = kApiFunctionCache;
var serialNumber = %GetTemplateField(data, kApiSerialNumberOffset);
var isFunctionCached =
(serialNumber in cache) && (cache[serialNumber] != kUninitialized);
if (!isFunctionCached) {
try {
cache[serialNumber] = null;
View scope-example.js
obj = {
a : function(){
print('im a')
b : function(){
var self = this
print('im b')
function c(){
View preact.go
// Package preact provides bindings to the preact library.
package preact
import ""
var preact = js.Global.Get("preact")
// Attrs of an element.
type Attrs map[string]interface{}
tj / git
Last active Feb 22, 2019
Some helpful git aliases
View git
alias gd="git diff"
alias gc="git clone"
alias ga="git add"
alias gbd="git branch -D"
alias gst="git status"
alias gca="git commit -a -m"
alias gpt="git push --tags"
alias gp="git push"
alias gpr="git pull-request"
alias grh="git reset --hard"
You can’t perform that action at this time.