Skip to content

Instantly share code, notes, and snippets.

View bigomega's full-sized avatar

Bharath Raja bigomega

View GitHub Profile
@bigomega
bigomega / gist:3869102
Created October 10, 2012 23:01
BrainFuck Javascript Compiler
var strip=[0];
var index=0;
var loopStack=new Array();
var loopFlag=0;
var innerLoopCount=0;
input=document.getElementById('inp').value;
for(i=0;i<input.length;i++){
var element=input[i];
if(loopFlag==1){
if(element=='[')
@bigomega
bigomega / gist:4054638
Created November 11, 2012 11:31
Batman Logo (nolan's)
//THE DARK KNIGHT logo openGL code
//--Brad
//change the include files accordingly
#include <stdlib.h>
#include<GL/gl.h>
#include<GL/glu.h>
#include<GL/glut.h>
#include<unistd.h>
[{date:
'7-1-13',
pepsi: 2,
dietPepsi: 3
},{date:
'10-1-13',
mountainDew: 2,
frooti: 2,
@bigomega
bigomega / nde.py
Last active December 18, 2015 00:29
ND Encryption Algorithm
# **************************************************
# ND Encription algorithm (nde)
# - derived from phonetics of words
# - replacing the first two consonent sounds of every word
# - works best for tamil words written in english
# Authors:
# Bharath => Rabhath
# Dhinesh => Nidhesh
# **************************************************
@bigomega
bigomega / 07day.js
Last active December 20, 2015 12:56
Advent of Code problem solutions
// - If a is not found
// - iterate through the input
// - If it output doesn't exist
// - Check if inputs have value
// - If so calculate output and add value
// - Else add the equation
// - If the output has value(number), ignore
// - If the output has equation, try to calculate
// - Reapeat
@bigomega
bigomega / .gitignore
Last active February 7, 2016 16:44
Tic Tac Toe
/node_modules
npm-debug.log
@bigomega
bigomega / JQuerySahi.java
Last active February 3, 2016 17:45
jQuery helper for sahi
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.sf.sahi.client.Browser;
import net.sf.sahi.client.ElementStub;
public class JQuery {
protected Browser browser;
@bigomega
bigomega / load-test.sh
Created March 3, 2016 11:03
A simple bash script to do load (performance) testing of a web service
max="$1"
date
echo "url: $2
rate: $max calls / second"
START=$(date +%s);
get () {
curl -s -v "$1" 2>&1 | tr '\r\n' '\\n' | awk -v date="$(date +'%r')" '{print $0"\n-----", date}' >> /tmp/perf-test.log
}
@bigomega
bigomega / _board-utils.js
Last active March 23, 2016 22:27
simple tic-tac-toe
'use strict'
const _utils = require('./_utils')
function getColumns(game) { return game.board }
function getRows(game) { return _utils.inverse2D(game.board) }
function getNWDiagonals(game) {
return _utils.range(game.width + game.height - 1).map(edge => {
@bigomega
bigomega / wordcrack.js
Last active April 15, 2016 14:18
Solving wordcrack
'use strict'
const fs = require('fs')
// util function modified from github.com/bucaran/sget
function readLineSync(message) {
message = message || ''
const win32 = () => 'win32' === process.platform
const readSync = function(buffer) {
var fd = win32() ? process.stdin.fd : fs.openSync('/dev/stdin', 'rs')
var bytes = fs.readSync(fd, buffer, 0, buffer.length)