Skip to content

Instantly share code, notes, and snippets.

View tikurahul's full-sized avatar
:shipit:
Tinkering

Rahul Ravikumar tikurahul

:shipit:
Tinkering
View GitHub Profile

Keybase proof

I hereby claim:

  • I am tikurahul on github.
  • I am rahulrav (https://keybase.io/rahulrav) on keybase.
  • I have a public key whose fingerprint is 8C76 D1C5 CBF0 A3A9 FD08 3B55 D714 4037 52B4 07AB

To claim this, I am signing this object:

@tikurahul
tikurahul / expression.js
Created November 2, 2012 08:45
A simple expression evaluator, inspired by MongoDB.
// a simple expression evaluator
/*
{
"or": [
{"ne": ['foo', 'bar']}
]
}
*/
function evaluate(expression) {
@tikurahul
tikurahul / expense-reports.js
Last active October 12, 2015 12:08
Bank of America (Filter Credit Card Summary with Keywords)
var transactions = $('.trans-desc-cell'),
// important -> keywords need to be uppercase (as we are not making a case insensitive comparison)
keywords = ['SEA', 'OAK', 'FRAN', 'EXPEDIA', 'ALASKA', 'TAXI', 'DELTA', 'MAX', 'PACIFIC'],
i = 0,
j = 0,
match = false,
content = null,
$t = null;
for (i = 0; i < transactions.length; i += 1) {
@tikurahul
tikurahul / RoundedRectBitmapDrawable.java
Last active December 15, 2015 22:39
An implementation of -border-radius for Bitmaps in Android.
import android.content.res.Resources;
import android.graphics.Paint;
import android.graphics.BitmapShader;
import android.graphics.RectF;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
public class RoundedRectBitmapDrawable extends BitmapDrawable {
@tikurahul
tikurahul / chrome-omnibox-awesomeness
Created August 7, 2013 23:13
A technique to supercharge Chome's "Manage Search Engines" feature. Map this JavaScript URL to a Search Engine (e.g super), and then you can do something like: super [TAB] "code packageName branchName" which will get mapped to "https://code.amazon.com/packages/packageName/trees/branchName/"
javascript:
var patterns = {
'vs': 'https://devcentral.amazon.com/ac/brazil/directory/version-set/packages/{0}/{1}',
'code': 'https://code.amazon.com/packages/{0}/trees/{1}/'
};
var pattern = decodeURIComponent('%s');
var keys = pattern.split(' ');
var base = keys ? keys[0] : '';
var args = keys ? keys.slice(1) : [];
var url = patterns[base] || '';
@tikurahul
tikurahul / Barriers ?
Created November 13, 2013 22:29
Flow control with Generators
Please correct me if I am making incorrect assumptions:
The way everything works is
async(function *() {
// generator expression
// returns multiple promises
var x = yield $.ajax('http://x....');
var y = yield $.ajax('http://y....');
@tikurahul
tikurahul / gradle_tips.md
Created June 7, 2018 19:44
Gradle Tips & Tricks

Start your gradle task with --no-daemon -Dorg.gradle.debug=true and attach a Java Remote debugger.

@tikurahul
tikurahul / Makefile.cmake
Created December 26, 2018 02:07
Node Makefile
diff --git a/node/Makefile b/node/Makefile
index f8a68a2..e60c891 100644
--- a/node/Makefile
+++ b/node/Makefile
@@ -119,7 +119,7 @@ define Package/node/config
choice
prompt "ICU Selection"
default NODEJS_ICU_NONE
help
# setup piwheels
# https://www.raspberrypi.org/blog/piwheels/
sudo apt update -y
sudo apt upgrade -y
#helpful libraries (2 min)
sudo apt install build-essential python3-dev python3-distlib python3-setuptools python3-pip python3-wheel -y
sudo apt-get install git cmake pkg-config -y