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
import libtorrent as lt | |
from os import listdir | |
import json | |
def sizeof_fmt(num): | |
for x in ['bytes','KB','MB','GB']: | |
if num < 1024.0 and num > -1024.0: | |
return "%3.1f%s" % (num, x) | |
num /= 1024.0 | |
return "%3.1f%s" % (num, 'TB') |
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
import os | |
import requests | |
import XML2Dict # The PyPI installer doesn't work; get this from http://blha303.com.au/XML2Dict.zip | |
from sys import argv | |
apikey = argv[1] # Get your API key from http://www.thetvdb.com/wiki/index.php?title=Programmers_API | |
ids = {"The.Daily.Show": "71256", "The.Colbert.Report": "79274", "Craig.Ferguson": "73387"} | |
eplookupurl = "http://thetvdb.com/api/GetEpisodeByAirDate.php?apikey=%s&seriesid=%s&airdate=%s" | |
srslookupurl = "http://thetvdb.com/data/series/%s/en.xml" | |
# I hate working with XML, so let's make them dicts. |
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
import requests | |
from os import mkdir, sep, listdir | |
from BeautifulSoup import BeautifulSoup as Soup | |
# Load page | |
soup = Soup(requests.get("http://bropages.org/browse").text) | |
# Get rows excluding header | |
rows = soup.findAll('tr')[1:] | |
cmds = [] | |
# iterate over rows, get commands, save list without duplicates | |
for a in rows: |
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
<?php | |
if (isset($_GET['print'])) { | |
highlight_file(__FILE__); | |
die(); | |
} | |
function load_addon($filename) { | |
if (file_exists($filename)) { | |
include $filename; | |
} | |
} |
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
# Usage: python bestgameever.py <password> | |
# Hint: It's alphanumeric, less than 5 characters. | |
from sys import argv | |
import hashlib | |
code = "98f588baf6859ca943164042560b6479dc277a8c481f186b6ef1b03cb5670dcdbeb226cd2e3808fd12f0b84eff6803290e667735b49fc4134206997e2add5ddf" | |
if len(argv) > 1: | |
if hashlib.sha512(hashlib.md5(argv[1]).hexdigest()).hexdigest() == code: | |
print "Yep." | |
else: | |
print "Nope." |
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
import Skype4Py | |
skype = Skype4Py.Skype(Transport='x11') | |
print "\n\n".join(["%s: %s" % (a.Name, ", ".join([b.Handle for b in a.Members])) for a in skype.Chats]) |
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
from twisted.words.protocols import irc | |
from twisted.internet import protocol, task, reactor | |
from twisted.application import internet, service | |
import subprocess | |
nick = "Nexus" | |
user = "Nexus" | |
passw = "bouncer password" | |
jenkins_nick = "HawkJenkins" | |
jenkins_job = "Nexus" |
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
// Copying this into the browser console (when you have a chat tab selected) will open the Twitch panels in a new window. | |
$.getJSON("http://www.corsproxy.com/api.twitch.tv/api/channels/"+$('.selected')[0].textContent+"/panels", | |
function(result){ | |
var out = []; | |
$.each(result, | |
function(i, field){ | |
var outp = ""; | |
if (field["data"]["link"]) { | |
outp += "<a href=\"" + field["data"]["link"] + "\">"; | |
} |
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
<html> | |
<head> | |
<script src="jquery.js"></script> | |
</head> | |
<body> | |
<span id="VideoList"></span> | |
<script> | |
var videosPath = "/Videos/"; | |
var curdir = ""; | |
function updateList(data) { |
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
# Data can be retrieved (gzipped) from | |
# https://mega.co.nz/#!os4gjQBR!fspHcvoHZHDzN6IGtJgIXUh4N_ciIEL40tHoivqcKXg | |
# Currently this data only contains info for weekdays, as of 2014-06-20. I can't make the data | |
# collection process public, sadly, so please email me if you'd like saturday or sunday/holiday data. | |
# | |
# This is an example implementation of a program to read this data, in Python | |
# It replicates Transperth's service to look up the next five bus times to a stop, as seen here | |
# http://136213.mobi/Bus/StopResults.aspx?SN=14353 | |
# Please direct questions to steven+transperthdata@blha303.com.au | |
# |
OlderNewer