Skip to content

Instantly share code, notes, and snippets.

View sillykelvin's full-sized avatar

Kelvin Hu sillykelvin

View GitHub Profile
@sillykelvin
sillykelvin / main.c
Created November 6, 2013 08:02
A sample nmake project
#include <stdio.h>
#include "share1.h"
#include "share2.h"
#include "static.h"
int main() {
printf("hello world\n");
int a = 4;
int b = 2;
printf ("a: %d, b: %d\n", a, b);
@sillykelvin
sillykelvin / gist:6349027
Created August 27, 2013 02:30
Add two numbers presented as two lists, an exercise in Lisp-cn google group. See https://groups.google.com/forum/#!topic/lisp-cn/AVEjxh0A5r0
(define (list-add lst1 lst2)
(define (iter a1 a2 carry ret)
(cond ((and (null? a1) (null? a2))
(if carry
(append ret '(1))
ret))
((null? a1)
(if carry
(iter '(1) a2 #f ret)
(append ret a2)))
@sillykelvin
sillykelvin / answer-crack.sh
Created November 8, 2012 16:35
answer-crack
#!/bin/zsh
i=0
while [ $i -le 800 ]; do
echo trying the $i times...
i=$(($i + 1))
md5=$(curl http://yuyang.co/game/\?width\=$i\&k\=0eb46665addf43389ae950050f787a45 | md5sum)
#echo $md5
if [ "$md5" != "c92e32594fd6558d6e1df9ab77daca42 -" ]; then
echo width is found: $i
break