Skip to content

Instantly share code, notes, and snippets.

View bigomega's full-sized avatar

Bharath Raja bigomega

View GitHub Profile
@bigomega
bigomega / github.js
Last active October 29, 2024 07:43
Data collection for Appbase search
const got = require('got');
const gocha = "gotcha…"
const AUTH_KEY = ''
;(async () => {
try {
const { data, headers } = await got.post({
url: 'https://api.github.com/graphql',
headers: { Authorization: `bearer ${AUTH_KEY}` },
@bigomega
bigomega / himalayan-biking-trekking-camping-checklist.md
Last active August 11, 2021 19:21
Himalayan Biking + Trekking + Camping Checklist

Himalayan Biking + Trekking + Camping Checklist +

Utility

  • Tent
  • Sleeping bag
  • Blanket
  • Water bottles
  • Towel
  • Swiss army knife
  • An actual knife - emergencies

Keybase proof

I hereby claim:

  • I am bigomega on github.
  • I am bigomega (https://keybase.io/bigomega) on keybase.
  • I have a public key whose fingerprint is 35B8 190F 23C3 8576 1E8C 8C8E 8EB4 BBCA 4DF5 E11C

To claim this, I am signing this object:

@bigomega
bigomega / draw_hexagon.js
Created June 25, 2016 04:55
render a hexagon of elements in DOM
var hex_arrangement = [
'3333',
'32223',
'321123',
'3210123'
]
var hexval = {
0: [['profile', 'data-nav="home']],
1: [
['behance', 'https://www.behance.net/bigOmega'],
@bigomega
bigomega / mini_scraper.py
Last active May 18, 2016 00:49
Dota International 2016 PrizePool scraper
import urllib2, re, time, json, os
import gspread
from oauth2client.client import SignedJwtAssertionCredentials
html = urllib2.urlopen('http://www.dota2.com/international/battlepass').read()
prizepool = re.search('id=[\'"]prizepool[^>]*>[\n\r\t]*([^<\t\r\n]*)', html, re.IGNORECASE).group(1)
print(time.strftime('%H:%M - %m/%d/%Y'), prizepool)
print("Update it in Google sheets")
json_key = json.load(open(os.path.join(os.path.dirname(__file__), 'Personal hacks-0e20089bab35.json')))
@bigomega
bigomega / chain.js
Created April 16, 2016 11:42
Coding problem
dict = ['cat','cot','cog','bog','bat','bap','map', 'mat'];
start = 'cat';
end = 'map';
isLinked = function(w1, w2){
var flag = false;
for (var i = 0; i < w1.length; i++) {
if(w1[i] != w2[i]){
if(flag)
return false;
flag = true;
@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)
@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 / 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 / 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;