Skip to content

Instantly share code, notes, and snippets.

View jsocol's full-sized avatar
🙃
for oss: hoping to get back to a monthly check-in/update cadence

James Socol jsocol

🙃
for oss: hoping to get back to a monthly check-in/update cadence
View GitHub Profile
from boto.dynamodb2 import connect_to_region
from boto.provider import Provider
aws_settings_provider = Provider('aws')
def create_connection():
aws_region = # get the AWS region of the EC2 instance
# connect_to_region passes along the named arguments
# to the DynamoDBConnection class that gets created
@jsocol
jsocol / README.md
Created January 28, 2013 05:34 — forked from johan/README.md

The fun part of user scripting is deciding what happens. The boring part is scavenging the DOM for bits of templated data, or elements you want to mod.

Have on.js do it for you!

Hi!

I'm not currently looking for a job as I'm pretty happy at my current job.

However Mozilla is looking for a recruiting manager in Mountain View. Mozilla also has deep ties in the open source communities and it sounds like it might be an interesting fit for you. <OPTIONAL-ADDITIONAL-TEXT>

If you're interested in applying, check out our careers link:

@jsocol
jsocol / bugzilla.mozilla.org.js
Created January 11, 2012 00:39 — forked from potch/README.rst
BugColorZilla!
function textColor(bg) {
var r = parseInt(bg.substr(0,2),16),
g = parseInt(bg.substr(2,2),16),
b = parseInt(bg.substr(4,2),16);
var yiq = (r * 299 + g * 587 + b * 114) / 1000;
return yiq >= 128 ? "black" : "white";
}
function bgColor(el, i) {
return ("000000" + $.trim($("a", el).eq(i).text())).substr(-6);
SET @gid = (SELECT id FROM group WHERE name = 'staff');
INSERT INTO profile_groups SELECT
@gid, id FROM auth_user WHERE email LIKE '%@mozilla...;
@jsocol
jsocol / ClientStatsD.js
Created August 3, 2011 15:46 — forked from chowse/ClientStatsD.js
StatsD for Client-Side Interactions
if (!Date.now) {
Date.now = function() {
return (new Date()).getTime();
};
}
var StatsD = (function($, undefined) {
@jsocol
jsocol / gist:483950
Created July 21, 2010 02:33
WTF.bm - A WTF module for MozBot
###########################
# WTF Module #
###########################
# WTF.bm - the WTF module for MozBot 2.6
# The WTF Module counts all the "wtf"s it hears in any channel the bot
# is in, and when you ask it "wtfs" will tell you how many it's heard.
# @author James Socol <me@jamessocol.com>
# @license MIT/X11. Go nuts.
@jsocol
jsocol / git-req
Created June 25, 2010 02:16 — forked from endtwist/git-req
git-req
#!/bin/bash
# allows you to send pull requests from the command line
# usage: git req username [comparetobranch]
# or: git req username -m 'message'
# put somewhere in your PATH as git-req and make executable
usage()
{
cat << EOF
usage: $0 options