Skip to content

Instantly share code, notes, and snippets.

Avatar

Rahul Ravikumar tikurahul

View GitHub Profile
View keybase.md

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 Nov 2, 2012
A simple expression evaluator, inspired by MongoDB.
View expression.js
// a simple expression evaluator
/*
{
"or": [
{"ne": ['foo', 'bar']}
]
}
*/
function evaluate(expression) {
@tikurahul
tikurahul / expense-reports.js
Last active Oct 12, 2015
Bank of America (Filter Credit Card Summary with Keywords)
View expense-reports.js
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 Dec 15, 2015
An implementation of -border-radius for Bitmaps in Android.
View RoundedRectBitmapDrawable.java
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 Aug 7, 2013
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/"
View chrome-omnibox-awesomeness
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 Nov 13, 2013
Flow control with Generators
View Barriers ?
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....');
View blink(1) README.md
@tikurahul
tikurahul / gradle_tips.md
Created Jun 7, 2018
Gradle Tips & Tricks
View gradle_tips.md

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

View Makefile.cmake
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
View Donkey on Asus TinkerBoard S
# 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