Skip to content

Instantly share code, notes, and snippets.

View gjohnson's full-sized avatar

Garrett Johnson gjohnson

View GitHub Profile
  1. "Internet-based application service provider, namely, hosting, managing and maintaining software for transferring modules of code from a remote registry authority to one or more computers; providing a web site featuring use of software that enables users to transfer modules of code from a remote registry authority to one or more computers; providing a web site featuring non-downloadable software for transfer modules of code from a remote registry authority to one or more computers; providing a website featuring on-line non-downloadable software that enables users to transfer modules of code from a remote registry authority to one or more computers."

http://tsdr.uspto.gov/documentviewer?caseId=sn86185685&docId=APP20140208073406#docIndex=0&page=1

  1. "Computer software for transferring modules of code from a remote registry authority to one or more computers; computer programs and computer software for transf
@gjohnson
gjohnson / ex1.js
Created February 9, 2014 21:56
etcd + co
var etcd = require('..');
var co = require('co');
co(function *() {
try {
var leader = yield etcd.leader();
console.log(leader);
} catch (err) {
console.error(err);
@gjohnson
gjohnson / out.sh
Created January 30, 2014 18:54
Phantomjs warning on OSX 10.8
2014-01-30 13:52:56.614 phantomjs[15976:507] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
@gjohnson
gjohnson / cluster.sh
Last active January 4, 2016 04:09
Simple script to create 3 node rabbit cluster. I don't do shell script, don't make fun!
#
# Spin up 3 nodes.
#
$(RABBITMQ_NODE_PORT=5673 RABBITMQ_SERVER_START_ARGS="-rabbitmq_management listener [{port,15673}]" RABBITMQ_NODENAME=node01 rabbitmq-server -detached)
$(RABBITMQ_NODE_PORT=5674 RABBITMQ_SERVER_START_ARGS="-rabbitmq_management listener [{port,15674}]" RABBITMQ_NODENAME=node02 rabbitmq-server -detached)
$(RABBITMQ_NODE_PORT=5675 RABBITMQ_SERVER_START_ARGS="-rabbitmq_management listener [{port,15675}]" RABBITMQ_NODENAME=node03 rabbitmq-server -detached)
#
# Stop prior to forming cluster.
@gjohnson
gjohnson / magic.rb
Created January 19, 2014 04:46
ohhhhhhhh yeah
def self.method_missing(method, *args, &block)
attr = method.to_s.sub(/=$/, '').to_sym
return super unless user_config.key?(attr)
if method =~ /=$/
set(attr, args.first)
else
get(attr)
end
end
redis.setnx('unique-key|12345', 1, function (err, ok) {
if (err) return dealwithit(err);
if (ok) {
redis.hset('unique-key|12345|data', 'field', 'value', callback);
}
});
REPORTER = spec
BASE = .
default: install
install: node_modules
node_modules: package.json
@npm -s install
@gjohnson
gjohnson / superagent.md
Last active December 29, 2015 23:18
superagent2.0 thoughts.

superagent 2.0

Environments

It should officially support node and the browser through component(1). I don't personally want to worry about browserify, but if the desire is strong enough we can do that too.

The main goal here is to leverage component to share more internal code between node and the browser.

Plugins

@gjohnson
gjohnson / notes.md
Last active December 25, 2018 04:38
AMQP error handling.

Producer

Simple producer, nothing wrong here...

var amqp = require('amqp');

var connection = amqp.createConnection({
  port: 5672, host: 'localhost'
});