Skip to content

Instantly share code, notes, and snippets.

# To get to linux on chromebook
# Open crosh
:; shell
:; sudo startxfce4 #gui
:; sudo enter-chroot #cli
tnguyen14 / date.js
Last active Aug 29, 2015
Handlebars helpers
View date.js
var moment = require('moment');
var isString = require('amp-is-string');
Handlebars.registerHelper('date', function (date, format) {
var momentDate, formatStr;
// no date is passed in, default to current date
if ((date && {
momentDate = moment();
} else {
tnguyen14 / .editorconfig
Last active Aug 29, 2015
code linting configs
View .editorconfig
# EditorConfig is awesome:
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
end_of_line = lf
insert_final_newline = true
charset = utf-8
View gulp-browserify-watchify.js
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var xtend = require('xtend');
var browserify = require('browserify');
var watchify = require('watchify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var sourcemaps = require('gulp-sourcemaps');
var gutil = require('gulp-util');
tnguyen14 /
Created Aug 21, 2014
verifying keybase

Keybase proof

I hereby claim:

  • I am tnguyen14 on github.
  • I am tridnguyen ( on keybase.
  • I have a public key whose fingerprint is 58AE 1C01 9F79 B0E5 A777 9D0F 3921 FE84 3611 8156

To claim this, I am signing this object:


When you modify a file in your repository, the change is initially unstaged. In order to commit it, you must stage it—that is, add it to the index—using git add. When you make a commit, the changes that are committed are those that have been added to the index.

git reset changes, at minimum, where your current branch is pointing. The difference between --mixed and --soft is whether or not your index is also modified. So, if we're on branch master with this series of commits:

- A - B - C (master)

HEADpoints to C and the index matches C.


def inorder(node):
if node.left != None:
print node.cargo
if node.right != None:
def preorder(node):