PATH=$PATH:~/.local/bin
source /home/tao/.local/bin/virtualenvwrapper.sh
pip install virtualenvwrapper --user #make everything locally!!
vim, zsh is very hard to install locally without sudo permission.
function xhr(options) { | |
var deferred = Q.defer(), | |
req = new XMLHttpRequest(); | |
req.open(options.method || 'GET', options.url, true); | |
// Set request headers if provided. | |
Object.keys(options.headers || {}).forEach(function (key) { | |
req.setRequestHeader(key, options.headers[key]); | |
}); |
var mongoose = require('./db-connect'), | |
Schema = mongoose.Schema, | |
ObjectId = Schema.ObjectId, | |
uuid = require('node-uuid'), | |
Validator = require('validator').Validator, | |
val = new Validator(), | |
bcrypt = require('bcrypt'); | |
Validator.prototype.error = function(msg) { return false; }; |
/** | |
* Swap the elements in an array at indexes x and y. | |
* | |
* @param (a) The array. | |
* @param (x) The index of the first element to swap. | |
* @param (y) The index of the second element to swap. | |
* @return {Array} A new array with the elements swapped. | |
*/ | |
var swapArrayElements = function (a, x, y) { | |
if (a.length === 1) return a; |
// Place your settings in this file to overwrite the default settings | |
{ | |
"editor.fontSize": 15, | |
"editor.fontFamily": "Consolas", | |
"editor.tabSize": 2, | |
"editor.wordWrapColumn": 80, | |
"editor.fontLigatures": true, | |
"editor.snippetSuggestions": "top", | |
"editor.minimap.enabled": true, | |
"files.exclude": { |
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
//CSS | |
git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
git config --global alias.lol "log --graph --decorate --pretty=oneline --abbrev-commit --all"
git config --global alias.mylog "log --pretty=format:'%h %s [%an]' --graph"
To check that they've been added correctly, first run git config --list
. You should see something like this in the midst of all your other configuration:
alias.hist=log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short
# Copy the last commit in the current branch, or if passed as a parameter, a different branch. | |
# | |
# See the blog post documenting the surprisingly lengthly process of building this here: | |
# https://macarthur.me/posts/building-a-shell-function-to-copy-latest-commit-sha | |
function clc { | |
COLOR_GREEN="\033[0;32m" | |
COLOR_RESET="\033[0m" | |
[[ -z $1 ]] && BRANCH=$(git rev-parse --abbrev-ref HEAD) || BRANCH=$1 | |
LAST_COMMIT_SHA=$(git rev-parse $BRANCH | tail -n 1) |