Skip to content

Instantly share code, notes, and snippets.

View kdawes's full-sized avatar

Kelsey Dawes kdawes

  • Saskatoon, SK, Canada
View GitHub Profile
https://github.com/indexzero/winston-couchdb.git
$ git clone https://github.com/indexzero/winston-couchdb.git
Cloning into 'winston-couchdb'...
remote: Counting objects: 60, done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 60 (delta 28), reused 59 (delta 27)
Unpacking objects: 100% (60/60), done.
whistler:tmp kdawes$ cd winston-couchdb/
whistler:winston-couchdb kdawes$ ls
@kdawes
kdawes / gist:4221320
Created December 6, 2012 02:18
winston-couchdb tests running on travis-ci.org - one failing
Current
Build History
Pull Requests
Branch Summary
Build 3 Finished2 minutes from nowDuration32 secCommitb902861 (master)Compare4fb18a750ef7...b90286134e2dAuthorKelsey DawesCommitterKelsey DawesMessageone letter change to force a buildConfigNodeJs: 0.8
1$ cd ~/builds
2$ sudo service couchdb start
@kdawes
kdawes / gist:4228968
Created December 6, 2012 22:12
cradle / JSON.stringify / typeError
{ stack: 'TypeError: Converting circular structure to JSON\n
at Object.stringify (native)\n
at Connection.cradle.Connection.request (/tmp/winston-couchdb/node_modules/cradle/lib/cradle.js:182:29)\n JSON.stringify ( blammo :( )
atDatabase.query (/tmp/winston-couchdb/node_modules/cradle/lib/cradle/database/index.js:15:21)\n Database.prototype.query -> this.connection.request( options, callback )
at Database.post (/tmp/winston-couchdb/node_modules/cradle/lib/cradle/database/documents.js:71:10)\n Database.prototype.post
at Database._save (/tmp/winston-couchdb/node_modules/cradle/lib/cradle/database/documents.js:150:18)\n POST
at Database.save (/tmp/winston-couchdb/node_modules/cradle/lib/cradle/database/documents.js:92:10)\n _save
at Couchdb.log (/tmp/winston-couchdb/lib/winston-couchdb.js:91:15)\n
at Object.helpers.testLevels.circmetadatatest.topic (/tmp/winston-couchdb/node_modules/winston/test/helpers.js:165:17)\n
at run (/usr/local/lib/node_modules/vows/lib/vows/s
@kdawes
kdawes / gist:4230312
Created December 7, 2012 02:43
Builds pass
1$ cd ~/builds
2$ sudo service couchdb start
3[ OK ]
4$ sleep 3
5$ git clone --branch=master --depth=100 --quiet git://github.com/kdawes/winston-couchdb.git kdawes/winston-couchdb
6$ cd kdawes/winston-couchdb
7$ git checkout -qf 04a974024d6d471e311f6b6e5f8a43feb05abbc5
8$ nvm use 0.8
9Now using node v0.8.11
10$ node --version
var rg = function( err, response ) {
if ( err ) {
console.log("ERROR " + err);
} else {
var i = 1;
console.log("WE GOT " + response.rows.length);
_
.each(worldmap.names, function( country ) {
sums[country.name] = {};
sums[country.name].infected = 0;
perl -ne 'print unless /^\n/' < call2464.txt | awk '{print $2$3$4$5$6$7$8$9}'
3b4130411e41020002120f4e8f10024f
32d00080b012100032413041d21a189a
22dc45b942792d55858ea4a267d714ae
a11976f642cb1c040efaa61b74a7416b
d237a25322e466afc1a5938b89719b88
fa9b66744e212a6bb14391513dcca6f5
daa7db3f8d3c4d184736dfa6459a2461
921d329114e68157b0fe2ddd400b8688
63103ab3612b0bd9483f4e0458704c38
400: 0b12 0412 0441 2452 3150 e0ff 3b40 2045 .....A$R1P..;@ E
2410: 073c 1b53 8f11 0f12 0312 b012 6424 2152 .<.S........d$!R
2420: 6f4b 4f93 f623 3012 0a00 0312 b012 6424 oKO..#0.......d$
2430: 2152 3012 1f00 3f40 dcff 0f54 0f12 2312 !R0...?@...T..#.
2440: b012 6424 3150 0600 b490 ca1b dcff 0520 ..d$1P.........
@kdawes
kdawes / index.js
Created April 29, 2015 05:33 — forked from tmpvar/index.js
requirebin sketch
var fc = require('fc');
var center = require('ctx-translate-center');
var poly = require('ctx-render-polyline');
var points = require('ctx-render-points');
var bounds2 = require('2d-bounds');
var gridlines = require('ctx-render-grid-lines');
var isect = require('robust-segment-intersect');
var createSDF = require('sdf-polygon-2d');
var area = require('2d-polygon-area');
var segseg = require('segseg');
#!/bin/bash
ADB=$(which adb)
DIRNAME=$(which dirname)
HTTP_SERVER=$(which http-server)
CORDOVA=$(which cordova)
WORKING_DIR="./sync"
BUILD_LOG="/tmp/build.log"
#Relies on the fact that the cordova build process log ends with the apk path
APK=$(cd ${WORKING_DIR} && ${CORDOVA} build > ${BUILD_LOG} 2>&1 && tail -n 1 ${BUILD_LOG} | tr -d ' ')
echo "Using ${APK}"
@kdawes
kdawes / node-and-npm-in-30-seconds.sh
Last active September 17, 2015 15:51 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh