Skip to content

Instantly share code, notes, and snippets.

View askedrelic's full-sized avatar

Matt Behrens askedrelic

View GitHub Profile
import requests
import base64
# requires pygithub library
from github import Github
g = Github(username, password)
repo_readmes = {}
for repo_name in uniq_popular_repos:
@askedrelic
askedrelic / gist:4651871
Created January 28, 2013 01:05
top 20 most watched github repos across all languages
import requests
import re
popular_repos = []
lang_page = requests.get('https://github.com/languages')
popular_langs = list(set(re.findall('href="/languages/(.*?)"', lang_page.content)))
for lang in popular_langs:
most_watched_lang_page = requests.get('https://github.com/languages/{0}/most_watched'.format(lang))
@askedrelic
askedrelic / gist:4597730
Last active August 15, 2017 07:49
Timezones array
TIMEZONES = [
('Pacific/Pago_Pago', "-11:00 - Samoa, Midway Island"),
('America/Adak', "-10:00 - Aleutian Islands"),
('Pacific/Honolulu', "-10:00 - Hawaii"),
('Pacific/Marquesas', "-09:30 - Marquesas Islands"),
('Pacific/Gambier', "-09:00 - Gambier Islands"),
('America/Anchorage', "-09:00 - Alaska"),
('America/Los_Angeles', "-08:00 - US Pacific Time (US & Canada)"),
('Pacific/Pitcairn', "-08:00 - Pitcairn Islands"),
('America/Phoenix', "-07:00 - Arizona Mountain Standard Time"),
from libgreader import GoogleReader, ClientAuthMethod
username = ''
password = ''
ca = ClientAuthMethod(username,password)
reader = GoogleReader(ca)
info = reader.getUserInfo()
reader.subscribe('feed/http://blog.aboutecho.com/feed/')
reader.buildSubscriptionList()
/bin/p4merge
#!/bin/bash
for arg; do [[ $arg = /* ]] || arg=$PWD/$arg; absargs+=("$arg"); done;
/Applications/p4merge.app/Contents/Resources/launchp4merge "${absargs[@]}"
.gitconfig
[merge]
tool = p4merge
@askedrelic
askedrelic / gist:897652
Created April 1, 2011 02:50
toggle audio source on OSX
set the currentSource to (do shell script "/Users/askedrelic/bin/SwitchAudioSource -c")
if currentSource is equal to "Built-in Output" then
do shell script "/Users/askedrelic/bin/SwitchAudioSource -s \"Built-in Line Output\""
else
do shell script "/Users/askedrelic/bin/SwitchAudioSource -s \"Built-in Output\""
end if
server {
listen 80;
server_name www.thebehrensventure.com;
rewrite ^/(.*) http://thebehrensventure.com/$1 permanent;
}
server {
listen 80;
server_name thebehrensventure.com;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?q=$1 last;
break;
}
@askedrelic
askedrelic / api.py
Created February 17, 2011 00:04
Dynamic Fabric functions
#!/usr/bin/python
# vim:ts=2:sw=2:expandtab
"""
A Python library to perform low-level Linode API functions.
Copyright (c) 2010 Timothy J Fontaine <tjfontaine@gmail.com>
Copyright (c) 2010 Josh Wright <jshwright@gmail.com>
Copyright (c) 2010 Ryan Tucker <rtucker@gmail.com>
Copyright (c) 2008 James C Sinclair <james@irgeek.com>