Skip to content

Instantly share code, notes, and snippets.

View auscompgeek's full-sized avatar

David Vo auscompgeek

View GitHub Profile
@auscompgeek
auscompgeek / minecraft.sh
Created January 3, 2012 00:43
VERY simple Bash launcher for Minecraft client
#!/bin/bash
# MIIIINECRAFT!!! (No authentication :p)
# Configuration section:
mc_dl_path="https://s3.amazonaws.com/MinecraftDownload/" #where all minecraft downloads are
lwjgl_version="2.8.1" #which version of LWJGL you wish to update to by default
cmd_get="wget" #what command you use to GET files
HOME="." #path where you want .minecraft
cd
@auscompgeek
auscompgeek / grabthatskin.sh
Created June 3, 2012 07:14
Grab That Skin (bash version) - get Minecraft skins
#!/bin/sh
# Grab That Skin - Minecraft skin getter
# bash script rewrite by auscompgeek
# original batch script by smibo
echo Grab That Skin - by auscompgeek
#skin_src='http://minecraft.net/skin/'
skin_src='http://s3.amazonaws.com/MinecraftSkins/'
#skin_src='https://s3.amazonaws.com/MinecraftSkins/'
@auscompgeek
auscompgeek / xkcd_download.py
Last active April 30, 2021 23:07
A forwards and backwards compatible xkcd downloader written in Python.
#!/usr/bin/env python
# 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/.
"""An xkcd downloader by auscompgeek.
This Python script will download all xkcd comics within the range specified.
Both Python 2.x and 3k are supported. Tested on Python 2.7.3 and 3.2.1.
@auscompgeek
auscompgeek / C-large-1.py
Last active December 16, 2015 06:49
Google Code Jam - Qualification Round 2013 - C. Fair and Square - large 1 input
#!/usr/bin/python3
import re
from math import ceil, sqrt
MAY_BE_PALINDROMIC_ROOT = re.compile(r'(?:[123]|[12][012]*[12])$')
palindromes = []
def is_palindrome(S):
#return S == S[::-1]
l = len(S)
@auscompgeek
auscompgeek / exam_statistics.pas
Last active December 19, 2015 13:58
prelim SDD assignment - turn exam scores into statistics (spot the non-standard pascal)
{
exam_statistics.pas - transform exam scores into statistical information
Copyright (c) 2013 David Vo
All rights reserved
(unless specified)
This program is designed to take class scores from an exam out of 10 (no full marks)
and display a horizontal histogram and the mean, median, and range of the scores.
}
@auscompgeek
auscompgeek / anagrams.py
Last active November 27, 2017 21:47
anagram generator written in Python
#!/usr/bin/python3
# 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/.
def get_sword(word):
return "".join(sorted(word.replace("'", "").lower()))
def get_words(words="/usr/share/dict/words"):
@auscompgeek
auscompgeek / _scrape_bom_names.py
Last active December 24, 2015 21:29
scrape BoM for a station name to ID mapping in INI format
#!/usr/bin/env python3
import re
import requests
states = [
("nsw", 'N'),
("vic", 'V'),
("qld", 'Q'),
("wa", 'W'),
@auscompgeek
auscompgeek / gist:1e60032d1c84ecea81c3
Last active January 2, 2018 05:18
hack.lu CTF - packed - brute-force the xor cipher
#!/usr/bin/python3
# hack.lu CTF - packed - brute-force the xor cipher
CIPHERTEXT = "H51\\\'Ux2J&+(3Z;Uxcx0Xxs\x13h\x014$V!R($R>\t/)R!\x01<.\x13,N-aP4M4aRuG1-VuU0 GuH+a@0W=3R9\x01>(_0\x01,8C0Rx GuN6\"V|\x1ezKZ3\x014$]}R!2\x1d4S?7\x1au\x1fxs\t_\x01xa\x13<Gx)R&Ip2J&\x0f93T#zj\x1c\x1ap\x13rk\x00g\x01e|\x13g\x19ju\x0ba\x18jt\x02o+xa\x13u\x01xa\x13%S1/Gu\x03\x1b.\\:N7.\\:N4o\x13\x0cN-3\x133M9&\x13<Rx A2WjiZ{DvaX0Xjh\x136N6\"R!\x01\x07rC0p\x138a\x1dc22ieu\x161Fw+=-@0\x1bRa\x13u\x01(3Z;UxcR\'F.s\x1c>D!s\x13<Rx,Z&R1/Tw+R"
import itertools
import string
def code(key, cipher):
while len(key) < len(cipher):
@auscompgeek
auscompgeek / cz_sasl.js
Last active July 14, 2020 11:35
SASL plugin for ChatZilla by Gryllida, cleaned up
/* 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/. */
/*
* SASL plugin for ChatZilla.
*
* ChatZilla is a clean, easy to use and highly extensible Internet Relay Chat (IRC) client.
* Get it here: https://addons.mozilla.org/addon/16
* Standalone version here: http://chatzilla.rdmsoft.com/xulrunner/
*
@auscompgeek
auscompgeek / README.md
Last active January 8, 2016 11:14
NyanFlip - An extension of BackFlip by Peter Ward (@flowblok). An example program is attached.

NyanFlip

An extension by Peter Ward (@flowblok) of the [BackFlip][1] esoteric programming language.

Here follows the original description by @flowblok from the NCSS 2014 Programming Competition:

Nyan Cat is stuck in an arcade game! You have the feeling that she's trying to get a message to you, but the game is running so slowly it will take days until she completes her message. The game is played on a 2D grid. Nyan Cat enters at the top-left corner, and starts by moving one tile to the right every turn. Some tiles have things displayed on them:

  • Arrows (<, >, ^ and V): When Nyan Cat steps on one of these, it changes her direction so she is now moving in the direction the arrow pointed in. However, that arrow then changes direction to point back the way she came from.