Skip to content

Instantly share code, notes, and snippets.

View cmcavoy's full-sized avatar

Chris McAvoy cmcavoy

View GitHub Profile
@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!');
@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
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...}
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]
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