Skip to content

Instantly share code, notes, and snippets.

Avatar
🤠
I may be slow to respond.

Arun Karunagath kra3

🤠
I may be slow to respond.
View GitHub Profile
View get-unique-strings-from-api.js
// no way to reset, at the moment
const get = (() =>{
let counter = 0;
return (url) => {
return new Promise((resolve, reject) => {
if(counter > 100) {
reject(false);
}
View keybase.md

Keybase proof

I hereby claim:

  • I am kra3 on github.
  • I am kra3 (https://keybase.io/kra3) on keybase.
  • I have a public key ASDFa3YNbsbfrmC-8WfUOSMiBDUfYeRpU7-5-EDSFXrisgo

To claim this, I am signing this object:

@kra3
kra3 / The Technical Interview Cheat Sheet.md
Created Feb 17, 2017 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat Sheet.md

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@kra3
kra3 / sublime_py_proj_with_venv.json
Created Jan 5, 2017
Sublime project settings - python project with virtualenv
View sublime_py_proj_with_venv.json
{
"Python": {
"python": "~/.envs/<virtual_env_name>/bin/python",
"pythonExtraPaths": [
"~/.envs/<virtual_env_name>/lib/python3.5/site-packages/"
]
},
"folders": [
{
"path": "<relative_project_path_from_this_file>",
@kra3
kra3 / maven tips.sh
Last active Nov 6, 2018
Speed up maven build times.
View maven tips.sh
# rip off from https://zeroturnaround.com/rebellabs/your-maven-build-is-slow-speed-it-up/
# in .bashrc
set MAVEN_OPTS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
# add -DdependencyLocationsEnabled=false to retain fewer outgoing connections.
# compile all modules
mvn -T 1C install -offline
@kra3
kra3 / flatten.js
Created Dec 13, 2016
flatten a nested array
View flatten.js
// function definition ES6
let flatten = (arr, res=[]) => {
for(let itm of arr){
Array.isArray(itm)? flatten(itm, res): res.push(itm);
}
}
// calling the function
let result = [];
flatten([1,2, [3, 4], [5, [6, 7, [8, 9]]]], result);
@kra3
kra3 / recover_tmux.sh
Created Mar 7, 2016
Try recovering a misbehaving tmux attach
View recover_tmux.sh
# to try recover a closed tmux session
# if the attach is not working while the socket is still there
# at /tmp/tmux-XXX/<default>
killall -10 tmux
@kra3
kra3 / py_unquote.js
Last active Aug 29, 2015
urllib.unquote in JavaScript
View py_unquote.js
// LICENCE: BSD 3 Clause
var _hexDig = "0123456789ABCDEFabcdef";
var _hexToChar = {};
var i, j;
// generate convertion map
for(i in _hexDig){
for(j in _hexDig){
var key = _hexDig[i] + _hexDig[j] ;
@kra3
kra3 / wiki_helper.py
Last active Oct 29, 2017
A generic script for text processing originally written specific to some usecases around wiki text.
View wiki_helper.py
# -*- coding: utf-8 -*-
__author__ = 'Arun KR (kra3) <the1.arun@gmail.com>'
__license__ = 'Simplified BSD'
import sys
"""
wiki_helper.py rules.txt data.txt > result.txt