Skip to content

Instantly share code, notes, and snippets.

View xuanvu's full-sized avatar

Kenny Nguyen xuanvu

View GitHub Profile
# adding and committing
git add -A # stages All
git add . # stages new and modified, without deleted
git add -u # stages modified and deleted, without new
git commit --amend # Add staged changes to previous commit. Do not use if commit has been pushed.
git commit --amend --no-edit # Do so without having to edit the commit message.
# remotes - pushing, pulling, and tracking
git fetch # gets remote objects and refs. Needed if new branches were added on the remote.
git remote -v # Lists all remotes (verbose)
@xuanvu
xuanvu / .profile
Last active August 29, 2015 14:09 — forked from ssbarnea/.profile
alias dos2unix-recursive='find . -iname '*.tpl' | xargs dos2unix'
alias edit='mcedit'
alias del='rm'
alias deltree='rm -r'
alias dir='/bin/ls $LS_OPTIONS --format=vertical'
alias attrib='chmod'
alias chdir='cd'
alias copy='cp'
alias ls='ls -a'
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
NeedsTimingInfo = true;
var start = Date.now(),
triggered = false,
prev;
var PluginParameters = [
{
name: "Window Length",
defaultValue: 80,
@xuanvu
xuanvu / ConverttoLINQ.cs
Created September 28, 2012 20:37
Convert multiple lines of condition into 1 single line of LINQ statement
private static bool DoSomething(string name)
{
var result = false;
if(name == "SomeName")
{
result = true;
}
return result;
@xuanvu
xuanvu / Comparison.cs
Created April 24, 2012 20:37
Comparison
public class Comparison
{
public void Compare()
{
StringBuilder sb1 = new StringBuilder("Markit on Demand");
StringBuilder sb2 = new StringBuilder("Markit on Demand");
var compare = sb1 == sb2;
var equals = sb1.Equals(sb2);
@xuanvu
xuanvu / uri.js
Created April 24, 2012 02:27 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"