Skip to content

Instantly share code, notes, and snippets.

View chromebook.sh
# To get to linux on chromebook
# Open crosh
:; shell
:; sudo startxfce4 #gui
:; sudo enter-chroot #cli
@tnguyen14
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 && date.data)) {
momentDate = moment();
} else {
@tnguyen14
tnguyen14 / .editorconfig
Last active Aug 29, 2015
code linting configs
View .editorconfig
# EditorConfig is awesome: http://EditorConfig.org
# 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
tnguyen14 / keybase.md
Created Aug 21, 2014
verifying keybase
View keybase.md

Keybase proof

I hereby claim:

  • I am tnguyen14 on github.
  • I am tridnguyen (https://keybase.io/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:

View git-reset-guide.md

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.

--soft

View tree-orders.py
def inorder(node):
if node.left != None:
inorder(node.left)
print node.cargo
if node.right != None:
inorder(node.right)
def preorder(node):