Skip to content

Instantly share code, notes, and snippets.


Tuan Nguyen tuannat

View GitHub Profile

Fixing npm On Mac OS X for Homebrew Users

If you just want to fix the issue quickly, scroll down to the "solution" section below.

Explanation of the issue

If you're a Mac Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you will see an error like this:

$ npm update npm -g
View CSS-modal.markdown
View sublime_config
"auto_complete_delay": 500,
"caret_style": "solid",
"color_scheme": "Packages/Theme - Flatland/Flatland Monokai.tmTheme",
"detect_indentation": false,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
# Sublime Text 3 install with Package Control
# Run this script with:
# $ curl -L | sh
# Detect the architecture
tuannat / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View git-aliases.gitconfig
ci = commit
br = branch
co = checkout
df = diff
st = status -b -s
last = log -1 HEAD
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
testmerge = merge --no-commit --no-ff
unstage = reset HEAD
View gist:6045632
class Graph {
num nodesNumber;
List<List<num>> edges;
Graph(this.nodesNumber, List<List<num>> edges) {
this.edges = new Iterable.generate(nodesNumber,
(_) => new List.fixedLength(nodesNumber)).toList();
for (var e in edges) edge(e[0], e[1], e[2]);
# -*- coding: utf-8 -*-
import Image
def resize_and_crop(img_path, modified_path, size, crop_type='top'):
Resize and crop an image to fit the specified size.
img_path: path for the image to resize.
tuannat / google_twunter_lol
Created Oct 31, 2012 — forked from jamiew/google_twunter_lol
All the dirty words from Google's "what do you love" project:
View google_twunter_lol
tuannat / chat-frontend.js
Created Oct 29, 2012 — forked from martinsik/chat-frontend.js
Node.js chat frontend and server
View chat-frontend.js
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;