Skip to content

Instantly share code, notes, and snippets.

View leikahing's full-sized avatar
🧧
Chaining the blocks

William Lee leikahing

🧧
Chaining the blocks
View GitHub Profile
@leikahing
leikahing / smiley.txt
Created August 21, 2011 18:57
Smiley
ಠ_ಠ
@leikahing
leikahing / usnow
Created August 22, 2011 21:04
Unicode Snowman
@leikahing
leikahing / rebase_all.sh
Created September 7, 2011 18:13
super hack!
#!/bin/bash
# Hacky script to see what we have that's not in SVN,
# and what we don't have that's in SVN
listfile="dirlist.txt"
svnfile="svnlist.txt"
rm $listfile $svnfile
touch $listfile $svnfile
@leikahing
leikahing / hugspls
Created September 15, 2011 17:36
Hug smiley
(ノ゜ω゜)ノ
@leikahing
leikahing / checkoutCurrent.sh
Created September 20, 2011 21:30
Getting current revision for project
revision=`svn info https://svn.hubteam.com/svn/python/${missing} | grep Rev: | gcut -c19-`
echo "git svn clone -r $revision https://svn.hubteam.com/svn/python/${missing}"
@leikahing
leikahing / dating_sim.py
Created September 28, 2011 03:58
Dating Sim
#!/usr/bin/env python
def main():
choices = ['Touch her boobs',
'Fondle her butt',
'Put it in',
'Put it in...with rape']
subchoices = ['Finger her pussy', 'Lick her nipple', 'Eat her kitty']
@leikahing
leikahing / funions.c
Created October 3, 2011 02:20
Hiding stuff from strings
#include <stdio.h>
#include <string.h>
typedef union {
double ds[2];
char ca[16];
} Funion;
char funyuns[10];
int main() {
@leikahing
leikahing / euler215.cxx
Created October 19, 2011 22:08
Project Euler 215 in C++
#include <vector>
#include <unordered_map>
#include <iostream>
#include <stdint.h>
//#include <deque>
const int WIDTH = 32;
const int HEIGHT = 10;
const int SBLOCK = 2;
const int LBLOCK = 3;
@leikahing
leikahing / rectangles.py
Created November 21, 2011 02:45
rectangles of death
from collections import namedtuple
# the seq above should produce 9 (3 up, 3 wide from [4,3,3]).
# if we start with 4 add it to a list. If we encounter 3, then it's lower than 4, so remove 4 from the list. Then encounter 3 again, then encounter 1.
Bar = namedtuple('Bar', ['index', 'height'])
def max_rec(seq):
@leikahing
leikahing / itoa.cxx
Created November 30, 2011 22:28
Slightly weird itoa
#include <string>
#include <algorithm>
// convert an integer to string
std::string integer_to_ascii(int val) {
std::string ret;
// ex: given 2345, convert to "2345"
int valCopy = val;
bool isNegative = false;
if (valCopy < 0) {