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 / 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}+"
@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 / gist:a4390fb82a31ce69256b
Last active March 20, 2017 13:27
9447 CTF - future - Hypnotoad's (edited) transcript
# nmap -v -6 -n -Pn 2400:6180:0000:00d0::0264:7001 -sO
Starting Nmap 6.47 ( http://nmap.org ) at 2014-12-01 12:21 AEDT
Initiating IPProto Scan at 12:21
Scanning 2400:6180:0:d0::264:7001 [256 ports]
[...snip...]
Discovered open port 132/ip on 2400:6180:0:d0::264:7001
[...snip...]
Completed IPProto Scan at 12:25, 231.97s elapsed (256 total ports)
Nmap scan report for 2400:6180:0:d0::264:7001
@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 / 70-keyboard.hwdb
Last active March 25, 2022 12:44
HP Spectre x360 - 13-4007tu | Arch Linux | dmidecode, lscpu, lspci, lsusb
# systemd's udev hwdb breaks our keyboard tablet mode switcheroo thing. Fix it.
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHPSpectrex360Convertible*:pvr*
KEYBOARD_KEY_ab=unknown # emitted by brightness keys
KEYBOARD_KEY_d7=f22 # normal mode - turn touchpad on
KEYBOARD_KEY_d8=f23 # tablet mode - turn touchpad off