Ron DuPlain - PyOhio 2013
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
GIST_USER=sbp | |
function usage() { | |
echo Usage: $0 [command], where command is one of: | |
echo update - Gets any new gists for user | |
echo pull - Keep existing gists synced with server | |
echo sync - Do an update then a pull | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
AAAAAA.py | |
This script, when placed in a folder with other episodes, will find the next | |
episode number and query thepiratebay for the infohash of the most popular | |
match. | |
This script is only used to find shows that are freely available. | |
I personally enjoy Pioneer One and a bunch more films provided freely over at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AddEncoding gzip gz | |
RewriteEngine On | |
RewriteCond %{HTTP:Accept-Encoding} gzip | |
RewriteCond %{REQUEST_FILENAME}.gz -f | |
RewriteRule ^(.*)$ $1.gz [QSA,L] | |
<Files *.css.gz> | |
ForceType text/css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Given to the public domain | |
#No warranties | |
import urllib2 | |
import simplejson | |
def shorturl(urltoshorten): | |
"""Compress the URL using goo.gl take a look at https://developers.google.com/url-shortener/v1/getting_started | |
>>> shorturl('http://igor.tamarapatino.org') | |
'http://goo.gl/FxHOn' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import copy | |
f = open('weechat.conf', 'r') | |
formats = ['/join ', '/query '] | |
networks = { |
Let's say you have a gist (public or private) and someone forks it and makes changes to it. Awesome! However, now you want to merge in their changes to your gist. Unfortunately, it doesn't seem GitHub supports this via their website at the moment, however, you can still merge the gists with 'git' on the command line.
-
You want to clone your gist. You can locate the link for this under "Clone this gist"
➜ ~/dev » git clone https://gist.github.com/5315168.git Cloning into '5315168'...
remote: Counting objects: 6, done.
git.io is an awesome URL shortener provided by Github. It works when shortening URLs from *.github.com/* to a small https://git.io/ link.
>>> import requests
OlderNewer