Skip to content

Instantly share code, notes, and snippets.

View auscompgeek's full-sized avatar

David Vo auscompgeek

View GitHub Profile
@auscompgeek
auscompgeek / 1.py
Last active August 29, 2015 14:03
UNSW ProgComp 2014 open round - drop_table_teams' solutions
#!/usr/bin/env python3
# Task 1
# drop_table_teams
from urllib.parse import unquote
num_cases = int(input())
for i in range(num_cases):
print(unquote(input()))
@auscompgeek
auscompgeek / golfstats.py
Last active August 29, 2015 14:04
A golf statistics calculator, for NCSS Challenge code golf threads.
#!/usr/bin/env python3
import sys
def main():
if len(sys.argv) < 2:
sys.exit('Usage: golfstats.py 1.py ...')
for i in range(1, len(sys.argv)):
if sys.argv[i] == '-':
print(i, '...', sep='. ')
@auscompgeek
auscompgeek / Base16.md
Last active August 29, 2015 14:07
my own Base16 scheme (with customised TextMate theme)

base16-vovo

After switching around between Base16 themes and the Tomorrow Night themes, I found none of the Base16 themes really replicated the feel of the Tomorrow Night Bright theme well enough (even the new bright scheme). Default was too dull, bright was too bright... So I decided to roll my own. And here we are now.

Of course, then I felt that the TextMate theme (I regularly use Sublime Text 3, but also use vim) was somewhat braindead... so I decided to customise that as well.

I only use the dark theme, but the light scheme should look fairly decent as well (with the exception of the yellow and green [bases 0a and 0b]; suggestions welcome).

@auscompgeek
auscompgeek / get_mafia_votes.py
Last active August 29, 2015 14:13
grab a list of votes from a Facebook group post's comments
#!/usr/bin/env python3
import collections
import re
import requests
import sys
###### CHANGE THESE WHEN NECESSARY
access_token = 'generate one, use the Graph API Explorer if lazy'
post_id = 925687554138366
@auscompgeek
auscompgeek / ncssproxy.py
Last active August 29, 2015 14:15
An App Engine proxy to the old NCSS Challenge site.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"A Google App Engine proxy to the old NCSS Challenge website."
import re
import webapp2
from google.appengine.api import memcache, urlfetch
# An implementation of the james_curran variable #drjcfacts
# https://twitter.com/auscompgeek/status/551883315486019584
#
# Originally by @flowblok
# Improved by @auscompgeek
#
# Original version by @flowblok is available in r1 of this gist:
# https://gist.github.com/auscompgeek/3eea0698c4be5e0b69f2/e56d405d67309c6b121e0a6beb1f97a523281300
#
# TODO: fix for custom excepthooks such as the one in IPython
@auscompgeek
auscompgeek / cloudflare_ddns_aaaa.py
Last active August 29, 2015 14:17
update a AAAA record on CloudFlare with your computer's global IPv6 address
#!/usr/bin/env python3
import json
import os
import requests
import socket
CF_API_ZONE_BASE = 'https://api.cloudflare.com/client/v4/zones/'
@auscompgeek
auscompgeek / PKGBUILD
Last active August 29, 2015 14:25
elementary-xfce-icons 0.6 PKGBUILD
# Maintainer: Hugo Osvaldo Barrera <hugo@barrera.io>
# Contributor: Limao Luo <luolimao+AUR@gmail.com>
# Contributor: flan_suse <windows2linux@zoho.com>
# Contributor: auscompgeek <auscompgeek@zoho.com>
_pkgname=elementary-xfce
pkgname=$_pkgname-icons
pkgver=0.6
pkgrel=1
pkgdesc='Elementary icons forked, extended and maintained for Xfce.'
@auscompgeek
auscompgeek / config
Created September 22, 2015 12:18
i3 config
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
set $exi exec --no-startup-id
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:DejaVu Sans Mono 9
@auscompgeek
auscompgeek / debian.zsh-theme
Last active September 22, 2015 12:26
oh-my-zsh custom themes
# A Debian-bash-like prompt, with git status on the right.
#
# by auscompgeek
ZSH_THEME_GIT_PROMPT_PREFIX=" %F{green}%B"
ZSH_THEME_GIT_PROMPT_SUFFIX="%b"
ZSH_THEME_GIT_PROMPT_DIRTY=""
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_ADDED="%F{green}+"