Skip to content

Instantly share code, notes, and snippets.

View dkua's full-sized avatar

David Kua dkua

View GitHub Profile
@dkua
dkua / fuck.py
Created March 18, 2014 01:36
Python script for killing processes in a funny way.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os
if len(sys.argv) == 3 and sys.argv[1] == "you":
regular = u"abcdefghijklmnopqrstuvqxyz"
irregular = u"ɐqɔpǝɟƃɥıɾʞʃɯuodbɹsʇnʌʍxʎz"
flipped = dict(zip(regular, irregular))
print u"\n (╯°□°)╯︵ %s" % "".join(flipped[c] for c in reversed(sys.argv[2]))
@dkua
dkua / clever_average_student.go
Last active August 29, 2015 13:57
Go program for finding out the average number of students per section from the Clever API.
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
type Response struct {
{
"metadata": {
"name": "pyconca"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{