Skip to content

Instantly share code, notes, and snippets.

View novemberborn's full-sized avatar

Mark Wubben novemberborn

View GitHub Profile
@novemberborn
novemberborn / howto.md
Last active July 31, 2016 14:29
Obtaining Let's Encrypt certificates for CloudFlare origin servers, using wilee
@novemberborn
novemberborn / howto.md
Created February 18, 2016 17:47
Creating a PKCS#12 file from a Let's Encrypt certificate
@novemberborn
novemberborn / howto.md
Created February 17, 2016 17:32
CSR with subjectAltName on OSX

Copy /System/Library/OpenSSL/openssl.cnf to a new file.

Add the following at the end:

[ req ]
req_extensions = v3_req

[ v3_req ]
# Extensions to add to a certificate request
@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active April 19, 2024 18:20
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@novemberborn
novemberborn / setup.md
Created January 7, 2016 15:05
OS X Redirect ports 80 and 443 to 8080 and 8443 respectively

Changes with .dev domains in mind.

Create /etc/pf.anchors/dev, containing:

rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443

@novemberborn
novemberborn / setup.md
Created January 7, 2016 14:28
OS X Dnsmasq setup for .dev domains

Install dnsmasq using Homebrew. Edit the dnsmasq.conf file (Homebrew will tell you where to put it) to contain:

address=/.dev/127.0.0.1
listen-address=127.0.0.1

Then make sure Dnsmasq is running (again follow Homebrew instructions).

Create the /etc/resolver/dev directory (using root) if it doesn't exist yet and create a resolver for .dev:

@vvo
vvo / should-I-pin-npm-dependencies?.md
Last active March 8, 2017 22:12
About authoring frontend libraries, building them, publishing to npm and dependencies

You have a nice library published on npm but asking yourselve if you should declare your dependencies as lodash: "3.10.0" (known as "pin" a dependency) or lodash: "^3.10.0"?

As library authors we should not pin dependencies but ask our users to do use npm shrinkwrap in their own app.

Here's why:

Pinning dependencies will result in duplicated code and modules in builds

If you pin your dependencies the issue is that anyone using your module will may not benefit from shared dependencies. If your module user has lodash: "^3.11.0" then since you declared

@novemberborn
novemberborn / gist.md
Created August 6, 2015 15:22
Removing all unused docker containers and images
@branneman
branneman / better-nodejs-require-paths.md
Last active April 8, 2024 00:22
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@domenic
domenic / promises.md
Last active March 31, 2024 14:07
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.