Skip to content

Instantly share code, notes, and snippets.

@chanian
chanian / gitbranch.sh
Created December 2, 2010 20:55
Painless feature branch creation for all!
#!/bin/sh
if [ ! -d ./.git ]
then
echo "Not a git repository"
exit
fi
if [ $# -ne 1 ]
then
echo "Please provide a branch name to create and switch to"
exit
@chanian
chanian / TQINAT.c
Created December 1, 2010 04:49
TQINAT: (T)his (Q)uine (I)s (N)ot (A) (T)QINAT
#define B(x) x; printf("{ B(" #x ") }\n");
int main()
{ B(printf("#define B(x) x; printf(\"{ B(\" #x \") }\\n\");\nint main()\n")) }
@chanian
chanian / MyRobot.c
Created December 1, 2010 03:27
Afternoon hack, and relearning C. Find all paths of the dummy robot on a nxn grid.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>
int size;
int size_minus_1;
struct move {
int x;