Skip to content

Instantly share code, notes, and snippets.

View cmcavoy's full-sized avatar

Chris McAvoy cmcavoy

View GitHub Profile
@cmcavoy
cmcavoy / gist:10764441
Created April 15, 2014 19:42
keybase.md
### Keybase proof
I hereby claim:
* I am cmcavoy on github.
* I am cmcavoy (https://keybase.io/cmcavoy) on keybase.
* I have a public key whose fingerprint is 7944 78E6 B496 EB2B E3E8 D2B1 1878 30D5 0121 BE2F
To claim this, I am signing this object:
http://127.0.0.1:5984/jazzrecords/_design/artist yields:
{"_id":"_design\/artist","_rev":"3356225496","language":"javascript","views":{"artist":{"map":"function(doc) {\n emit(doc._id, doc.artist);\n}"},"chris":{"map":"function(doc) {\n emit(null, doc);\n}"}}}
Given the above, I assumed that http://127.0.0.1:5984/jazzrecords/_design/artist/_view/artist would give me a bunch of awesome data, but it gives me a 500
(smm)21:45:19-cmcavoy-~% wget http://127.0.0.1:5984/jazzrecords/_design/artist/_view/artist
--2009-10-01 21:45:21-- http://127.0.0.1:5984/jazzrecords/_design/artist/_view/artist
Connecting to 127.0.0.1:5984... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
message = 'chris is cool http://www.extjs.com/blog/2009/10/08/ext-js-designer-preview/ chris is cool'
url = 'http://www.extjs.com/blog/2009/10/08/ext'
new_url = 'http://bit.ly/QvMEU'
print message.replace(url, new_url) # 'chris is cool http://bit.ly/QvMEU-js-designer-preview/ chris is cool'
url_match = r'.*(http://[a-zA-Z0-9_.?=&/]*)'
m = re.match(url_match, message)
print m.groups()[0]
Here's my import order (not sure if it matters):
<script src="./lib/Lawnchair.js"></script>
<script src="./lib/LawnchairAdaptorHelper.js"></script>
<script src="./lib/adaptors/DOMStorageAdaptor.js"></script>
And here's the output when I try it in Firebug on FF 3.6:
>>> var people = new Lawnchair('people');
ReferenceError: WebkitSQLiteAdaptor is not defined { message="WebkitSQLiteAdaptor is not defined", more...}
@cmcavoy
cmcavoy / amazon_cpl_greasemonkey.user.js
Created February 2, 2011 17:34
draft of a greasemonkey script to add cpl data to amazon
// ==UserScript==
// @name Amazon CPL
// @namespace http://www.lonelylion.com/
// @description Check for CPL books from Amazon
// @include http://www.amazon.com/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
// ==/UserScript==
function addMenuItem(title, text) {
// adds a menu item to the product details on the amazon page
@cmcavoy
cmcavoy / credit_cards_suck.user.js
Created June 22, 2011 20:22
A greasemonkey script to replace the recommended follows with a picture of your latest friend!
// ==UserScript==
// @name Remove recommended follows from Twitter
// @namespace http://www.lonelylion.com/grease
// @include http://www.twitter.com/*
// @include http://twitter.com/*
// ==/UserScript==
var nice_friend = jQuery('img.user-profile-link')[0].src;
jQuery('.user-rec-inner').html('<img src="'+ nice_friend + '"> is super nice!');
atrium)03:07 PM:~/projects/atrium
$ ls -l ~/.ssh/atrium.pem
-r-------- 1 cmcavoy cmcavoy 1696 2011-06-01 10:35 /home/cmcavoy/.ssh/atrium.pem
(atrium)03:08 PM:~/projects/atrium
$ ssh -i ~/.ssh/atrium.pem -v skinnycorp@ec2-50-16-96-58.compute-1.amazonaws.com
OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to ec2-50-16-96-58.compute-1.amazonaws.com [50.16.96.58] port 22.
debug1: Connection established.
$ vows
···· ✓ OK » 3 honored (0.020s)
···· ············································ ······················· ·✗· ···
An awarded badge can be retrieved
✗ and updated without duplicating
TypeError: Property 'length' of object function ok(value, message) {
if (!!!value) fail(value, true, message, '==', assert.ok);
} is not a function
@cmcavoy
cmcavoy / gist:1678711
Created January 25, 2012 21:05
debugging session
$ node debug app.js
< debugger listening on port 5858
connecting... ok
debug> c
< express-csrf is deprecated. Please use Connect's csrf middleware instead
< info: environment: local
< info: opening server on port: 8888
< info: READY PLAYER ONE
break in controllers/backpack.js:203
201
vagrant@lucid32:~$ start-server
Error requiring supplied module "/home/vagrant/openbadges/app.js".
Error: Unable to load shared library /home/vagrant/openbadges/node_modules/bcrypt/build/Release/bcrypt_lib.node
at Object..node (module.js:475:11)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)
at require (module.js:373:17)
at Object.<anonymous> (/home/vagrant/openbadges/node_modules/bcrypt/bcrypt.js:5:18)