Instantly share code, notes, and snippets.


Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\"
View test.js
var express = require('express'),
app = express(),
cookieParser = require('cookie-parser'),
session = require('express-session'),
RedisStore = require('connect-redis')(session);
app.use(express.static(__dirname + '/public'));
app.use(function(req, res, next) {
if (~req.url.indexOf('favicon'))
return res.send(404);
View config
# Save following to ~/.ssh/config
Host {work}
HostName {work}
IdentityFile ~/.ssh/{work}
IdentityFile ~/.ssh/personal
View vimrc
" Inspired from
" Enable syntax colors
syntax enable
" Set line numbers
set number
set relativenumber
" Set tabs and spaces
View distance.js
// Point a1
// Point a2
let dx = a2.x - a1.x;
let dy = a2.y - a1.y;
let distance = Math.sqrt(dx*dx + dy*dy);
View loop.js
// Increase until a range is met then start again:
let range = 10;
let x = (x + 1) % range;
View Cache.js
* This snippet is now a small library!
* @link
View .gitignore_global
View toggle-multiple-buttons-with-different-text.js
disableCta: function() {
this.prop('disabled', true);
// or use your own class
// retain current text of the CTA in custom data attribute
// Used html() assuming it is a <button> element
this.attr('data-value', this.html());
View BaseEntity.php
namespace Foo\Bar\Entity;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping as ORM;
* BaseEntity