Skip to content

Instantly share code, notes, and snippets.

Vivek Kannan vivekannan

View GitHub Profile
@vivekannan
vivekannan / batterdog.sh
Last active Mar 26, 2016
Simple BASH Script to mind battery charge level.
View batterdog.sh
#!/bin/bash
if [[ $(cat /sys/class/power_supply/BAT0/status) == "Charging" ]]; then
exit
fi
charge=$(cat /sys/class/power_supply/BAT0/capacity)
icon="/usr/share/icons/HighContrast/32x32/status/battery-caution.png"
if [[ $charge < 10 ]]; then
@vivekannan
vivekannan / 8051-8085.asm
Last active Aug 29, 2015
A 8051 assembly program that can execute the 8085 instruction set from external memory.
View 8051-8085.asm
;Little Endian --> Lower bytes in lower address and higher bytes in higher address.
EQU LOOKUP #0FEH
EQU ACC 0E0H
EQU EPCL 14H
EQU EPCH 15H
EQU ESPL 16H
EQU ESPH 17H
EQU EL 18H
@vivekannan
vivekannan / Juck.java
Created Jan 11, 2015
A BrainF**k intepreter in Java.
View Juck.java
import java.util.Stack;
import java.util.Scanner;
import java.util.HashMap;
import java.io.FileReader;
import java.util.ArrayList;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
class Juck {
@vivekannan
vivekannan / 0hh1
Last active Aug 29, 2015
Solver solves 0hh1 levels.
View 0hh1
10
...rr..brb
..b...r.bb
.r....b...
.b.r...b..
r.........
r.....r..r
.rb..r..rr
b..b...r..
.....r...r
@vivekannan
vivekannan / Flowy.cpp
Last active Aug 29, 2015
Flowy generates (usually) solvable Flow Free levels.
View Flowy.cpp
//Has to be complied and built using the option -std=c++0x
//TODO: Beautify some of the functions. Introduce parameters to control the difficult of the generated board.
#include <tuple>
#include <ctime>
#include <vector>
#include <ctype.h>
#include <cstdlib>
#include <iostream>
typedef std::tuple<int, int, int> flow;
@vivekannan
vivekannan / Crazy Queens.cpp
Last active Aug 29, 2015
A quick N-Queens solver.
View Crazy Queens.cpp
#include <iostream>
#include <stdlib.h>
#include <time.h>
#define QUEENS 8
using namespace std;
class Board {
You can’t perform that action at this time.