Skip to content

Instantly share code, notes, and snippets.

View brettgullan's full-sized avatar

Brett Gullan brettgullan

View GitHub Profile
pipelines:
branches:
master:
- step:
name: Build static html files
image: node:8.9.4-slim
caches:
- node
script:
- npm install
@brettgullan
brettgullan / responsive-configuration-builder__image-src.js
Last active August 30, 2019 05:32
Responsive Configuration Builder - Token Builder Examples
import { TokenBuilder } from 'responsive-configuration-builder'
const template = 'https://picsum.photos/id/{id}/{width}/{height}'
const builder = TokenBuilder(template)
const spec = {
src: {
width: '240px',
ratio: '16 / 9',
@brettgullan
brettgullan / koa-skeleton.js
Last active September 19, 2018 23:16
Koa Skeleton
const Koa = require('koa')
const { errorHandler, errorLogger } = require('./errors')
const logHandler = require('./logger')
const configHandler = require('./config')
module.exports = ({ routes, logTag }) => {
const app = new Koa()
app.use(errorHandler)
app.use(logHandler)
@brettgullan
brettgullan / Daily Log.scpt
Created August 12, 2016 00:56
Append a time-stamped text string to a Daily Log entry in Evernote.
(*
Appends an entry to today’s Daily Record of Events in Evernote.
For best results, invoke the script from LaunchBar.
c.f. https://gist.github.com/csreed/666ceee01617800164fddebb0bdde872#file-new-planner-entry-scpt
*)
on run -- Called when the script is run normally
set theTitle to "Daily Record of Events for " & (do shell script "date '+%A, %B %e'")
display dialog "What did you do to reach your goals?" default answer "" with title theTitle

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 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 may see an error like this:

$ npm update npm -g
:: UPDATE YUM ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
sudo yum update -y
:: INSTALL WEBSERVER :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
sudo yum install httpd24
sudo service httpd start
sudo chkconfig httpd on
chkconfig --list httpd