Skip to content

Instantly share code, notes, and snippets.

View tnguyen14's full-sized avatar

Tri Nguyen tnguyen14

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

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

@tnguyen14
tnguyen14 / keybase.md
Created August 21, 2014 20:11
verifying keybase

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:

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 / .editorconfig
Last active August 29, 2015 14:13
code linting configs
# 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
@tnguyen14
tnguyen14 / date.js
Last active August 29, 2015 14:13
Handlebars helpers
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 / chromebook.sh
Created March 23, 2015 11:50
chromebook
# To get to linux on chromebook
# Open crosh
:; shell
:; sudo startxfce4 #gui
:; sudo enter-chroot #cli
@tnguyen14
tnguyen14 / localports.json
Created April 26, 2015 03:30
Local port mappings
{
"ledge-server": "3000",
"ledge": "4001",
"tridnguyen.com": "4000",
"cbtallc.com": "7000",
"read-server": "3030",
"forms": "3000"
}
@tnguyen14
tnguyen14 / carousel.js
Created July 27, 2015 15:52
webdriverio - click failure
Feb 01, 2016 2:34:45 PM INFO bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketBuildListener onStarted
BuildListener onStarted called.
Feb 01, 2016 2:38:00 PM INFO bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketBuildTrigger run
Build Skip.
Feb 01, 2016 2:43:00 PM INFO bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketBuildTrigger run
Build Skip.
Feb 01, 2016 2:48:00 PM INFO bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketBuildTrigger run
Build Skip.
Feb 01, 2016 2:48:59 PM INFO bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketBuildListener onStarted
BuildListener onStarted called.