Skip to content

Instantly share code, notes, and snippets.

@tjwebb
tjwebb / swaggertest1.json
Last active August 27, 2015 05:23
Swagger Testing
{
"swagger": "2.0",
"info": {
"title": "@balderdash/sails-crm",
"description": "",
"version": "0.0.0",
"contact": {
"name": "",
"url": "https://github.com/balderdash-projects/sails-crm"
@tjwebb
tjwebb / ursafail
Last active August 29, 2015 14:06
xtuple-server error logs
0 silly sys.paths eachTask
1 silly pg.config eachTask
2 silly pg.backup eachTask
3 verbose xtuple Compiling options for plan: copy-database
4 silly xt.database eachTask
5 silly sys.paths eachTask
6 silly pg.config eachTask
7 silly pg.backup eachTask
8 silly pg.fork eachTask
9 silly pg.restore eachTask
Scores = new Meteor.Collection('scores');
if (Meteor.isClient) {
var timer = null;
/**
Sets the counter and start the game timer.
*/
var start = function () {
Session.set("counter", 10);
var startTime = new Date().getTime();
var phrase = 'may the force be with you';
var key = "TZlKw4gd1qFQhA2CbMLa";
var urlBase = "http://thesaurus.altervista.org/service.php?language=en_US&output=json&key=" + key + "&word=";
async.mapSeries(
phrase.split(' '),
function (word, next) {
console.log('word', word);
request(urlBase + word, function(error, response, body) {
if (error) return console.error(error);
@tjwebb
tjwebb / gist:c8f9ced0c27d14d3f194
Last active August 29, 2015 14:23
Balderdash node.js Project Guidelines

Setup

When setting up a new project, the following tasks are to be completed, in order, before writing any code:

  1. Create a README file, and outline the basic purpose of the project
  2. If not a Sails.js application, run npm init
  3. Integrate CI (Travis-CI or CircleCI) with the project, and setup boilerplate mocha tests so that npm test doesn't fail.
  4. Integrate with CodeClimate

Development Cadence

@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
@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 / 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 / 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 () {