Skip to content

Instantly share code, notes, and snippets.

@tjwebb
tjwebb / example.js
Created February 9, 2017 19:36
React PropTypes ES6
// Okay:
const Foo = class Foo extends Component {
// ...
}
Foo.propTypes = {
// ...
}
export default Foo
@tjwebb
tjwebb / mapnik-3.0.9.rb
Created January 23, 2017 21:00
Mapnik 3.0.9 homebrew formula
class Mapnik < Formula
desc "Toolkit for developing mapping applications"
homepage "http://www.mapnik.org/"
url "https://github.com/mapnik/mapnik/archive/v3.0.9.tar.gz"
sha256 "f0242606096e2c4ca2cd0caac1ff0fd5f8054a38b5f288ba38b0e397b5b311b2"
revision 1
head "https://github.com/mapnik/mapnik.git"
bottle do
@tjwebb
tjwebb / keybase.md
Created January 2, 2017 16:00
keybase.md

Keybase proof

I hereby claim:

  • I am tjwebb on github.
  • I am tjwebb (https://keybase.io/tjwebb) on keybase.
  • I have a public key whose fingerprint is A5DB EC2A A8C3 B773 24B8 A129 22DF 962F 5114 A7DE

To claim this, I am signing this object:

@tjwebb
tjwebb / mocha-output.txt
Created December 7, 2016 22:12
trailpack-express test failure
47 passing (6s)
8 pending
2 failing
1) express options Should have default methods should return 500 page on GET /default/notFound:
Uncaught AssertionError: 'Error: Cannot find module &#39;./lib/mediaType&#39;<br> &nbsp; &nbsp;at Function.Module._resolveFilename (module.js:325:15)<br> == '<h1>500</h1>'
+ expected - actual
-Error: Cannot find module &#39;./lib/mediaType&#39;<br> &nbsp; &nbsp;at Function.Module._resolveFilename (module.js:325:15)<br> &nbsp; &nbsp;at Function.Module._load (module.js:276:25)<br> &nbsp; &nbsp;at Module.require (module.js:353:17)<br> &nbsp; &nbsp;at require (internal/module.js:12:17)<br> &nbsp; &nbsp;at loadModule (/Users/tjwebb/workspace/trails/trailpack-express/node_modules/express/node_modules/accepts/node_modules/negotiator/index.js:114:16)<br> &nbsp; &nbsp;at Negotiator.mediaTypes (/Users/tjwebb/workspace/trails/trailpack-express/node_modules/express/node_modules/accepts/node_modules/negotiator/index.js:76:29)<br> &nbsp; &nbsp;at Accepts.type.Accep
@tjwebb
tjwebb / es6-class-example.js
Created October 11, 2016 16:13
ES6 Class Example
class Foo {
test () {
return this.x
}
constructor () {
this.x = 1
}
}
class Bar {
test () {
@tjwebb
tjwebb / heroku-build.log
Created September 2, 2016 04:30
what the hell semver.io? >=4 should resolve to 6.5.0
Resolving node version >= 4.0.0 via semver.io...
Downloading and installing node 5.11.1...
@tjwebb
tjwebb / rfc1925.txt
Created March 26, 2016 20:29
RFC1925
Network Working Group R. Callon, Editor
Request for Comments: 1925 IOOF
Category: Informational 1 April 1996
The Twelve Networking Truths
Status of this Memo
This memo provides information for the Internet community. This memo
@tjwebb
tjwebb / load_history.js
Created March 19, 2016 07:01
Create a Node REPL with History
const repl = require(‘repl’)
const server = repl.start({ /* your config options */ })
// synchronous methods are fine, here. you don't want to run a REPL on any middleware that
// handles user requests, anyway.
fs.statSync('.node_repl_history')
// load command history from a file called .node_repl history in the current directory
fs.readFileSync('.node_repl_history')
.split(‘\n’)
@tjwebb
tjwebb / sails-swagger-api.json
Created September 12, 2015 19:13
Default Sails Swagger API
{
"swagger": "2.0",
"info": {
"title": "sails-swagger",
"description": "Example Sails Swagger Application. Documentation generated by the [sails-swagger](https://github.com/tjwebb/sails-swagger) plugin for [sails.js](http://sailsjs.org).",
"version": "1.0.0",
"contact": {
"name": "Balderdash, Inc.",
"email": "hello@balderdash.io",
"url": "http://www.balderdash.io"
@tjwebb
tjwebb / node4-socketio-npm-install
Created September 8, 2015 17:26
socket.io install failure in node 4.0.0
> bufferutil@1.1.0 install /home/tjwebb/workspace/balderdashy/sails/node_modules/sails-hook-sockets/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil
> node-gyp rebuild
make: Entering directory '/home/tjwebb/workspace/balderdashy/sails/node_modules/sails-hook-sockets/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:0:
../node_modules/nan/nan.h:261:25: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
^
../node_modules/nan/nan.h:256:25: note: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here