Skip to content

Instantly share code, notes, and snippets.

View jhildings's full-sized avatar

Johannes Hildingsson jhildings

  • Klickrent
  • Berlin
View GitHub Profile
@jhildings
jhildings / fix-homebrew-npm.md
Created April 26, 2016 13:10 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

@jhildings
jhildings / generate alphabet
Created December 19, 2014 14:51
Generate alphabet in javascript with fromcharcode
/**
*
Short way of generating alpabet
c (as in capital) for capital letters and l (as in lowercase) for lowercase letters
Only support english alphabet
**/
function generateAlphabet(c){
for(var i = 0; i < 26; i++) {
if(c == "c")