Skip to content

Instantly share code, notes, and snippets.

View Erichain's full-sized avatar

Erichain Erichain

View GitHub Profile

##Fixing npm permissions

You may receive an EACCES error when you try to install a package globally. This indicates that you do not have permission to write to the directories that npm uses to store global packages and commands.

You can fix this problem using one of three options:

Change the permission to npm's default directory. Change npm's default directory to another directory. Install Node with a package manager that takes care of this for you. You should back-up your computer before moving forward.

nepsilon /
Last active August 9, 2018 11:19
How to secure your site with HTTPS? — First published in issue #101

How to secure your site with HTTPS?

With HTTP everything is visible when traveling on the Internet. By generating an SSL certificate and configuring your webserver you can force browsers to use HTTPS. Here is how to proceed:

# 1. Install letsencrypt
sudo pip install letsencrypt
btfak /
Created May 26, 2016 09:41
How to use Hexo and deploy to GitHub Pages
bondden /
Last active May 19, 2016 02:07
Temporary fix for graceful-fs related Node.js 5 to 6 update error: (node:14471) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
#!/usr/bin/env bash
# Temporary fix for Node.js 5 to 6 aupdate error:
# (node:14471) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
# Updates any package by package name, version number, if set,
# or graceful-fs to 4.1.3 by default.
# By default runs npm dedupe after applying fixes
# Usage: bash ./ [MODULE VERSION [noddp]]
# where
makmanalp /
Last active June 10, 2024 14:24
Angular vs Backbone vs React vs Ember notes

Note: these are pretty rough notes I made for my team on the fly as I was reading through some pages. Some could be mildly inaccurate but hopefully not terribly so. I might resort to convenient fiction & simplification sometimes.

My top contenders, mostly based on popularity / community etc:

  • Angular
  • Backbone
  • React
  • Ember

Mostly about MVC (or derivatives, MVP / MVVM).

sean-hill / Ionic and ngCordova upload example
Last active May 6, 2019 01:52
Upload service for Ionic and ngCordova
Ionic and ngCordova upload example
fiznool / hashid.js
Created November 16, 2014 09:45
Short 'hash' ID generator.
'use strict';
* The default alphabet is 25 numbers and lowercase letters.
* Any numbers that look like letters and vice versa are removed:
* 1 l, 0 o.
* Also the following letters are not present, to prevent any
* expletives: cfhistu
staltz /
Last active July 15, 2024 15:43
The introduction to Reactive Programming you've been missing
jakemmarsh / directives.js
Created June 26, 2013 14:18
AngularJS directive to create a functional "back" button
app.directive('backButton', function(){
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', goBack);
function goBack() {
balupton /
Last active June 7, 2021 16:00
Node.js Best Practice Exception Handling