Skip to content

Instantly share code, notes, and snippets.

View aneilbaboo's full-sized avatar

Aneil Mallavarapu aneilbaboo

  • Precise.ly
  • San Francisco, CA
View GitHub Profile
@aneilbaboo
aneilbaboo / virtualenv.rvmrc
Last active October 20, 2015 18:58
This .rvmrc automatically creates/activates a python virtualenv
# save this file in the top level directory of your project as ".rvmrc"
# the virtualenv will be created/activated when you cd into the dir
if hash mkvirtualenv 2>/dev/null; then
virtualenv_name=$(basename `git rev-parse --show-toplevel`)
workon "$virtualenv_name"
if [ "$?" != "0" ]; then
mkvirtualenv "$virtualenv_name"
echo "\"pip install -r requirements.txt\" to install libraries"
fi
fi
@aneilbaboo
aneilbaboo / h
Last active September 26, 2016 18:35
Heroku shortcut - looks for git remotes, infers heroku app name and issues a heroku command
#!/bin/bash
remote="$1"
app=`git remote -v | awk -v pattern="^$remote" '{ if (match($1, pattern) && match($2, "git@.*") && match($2, "\:(.*)\.git")) { print substr($2, RSTART+1, RLENGTH-5); exit 1;}}'`
if [ "${app}" == "" ]; then
# regex is written in this hack way ("\.com/.*\.git" instead of "[^/]*.git") because Apple awk doesn't support character sets
app=`git remote -v | awk -v pattern="^$remote" '{ if (match($1, pattern) && match($2, "https") && match($2, "\.com/.*\.git")) { print substr($2, RSTART+5, RLENGTH-9); exit 1;}}'`
fi
if [ "$2" ]; then
@aneilbaboo
aneilbaboo / keybase.md
Created October 20, 2017 16:59
Keybase proof

Keybase proof

I hereby claim:

  • I am aneilbaboo on github.
  • I am aneil (https://keybase.io/aneil) on keybase.
  • I have a public key ASCCiXp668RDM0jhZfe12nDNKYrD2_M3fAaDfFoNTQ8aXwo

To claim this, I am signing this object:

@aneilbaboo
aneilbaboo / jsrsasign.d.ts
Last active September 10, 2018 17:31
Typescript declaration for jsrsasign
// An initial attempt at a Typescript declaration file for https://github.com/kjur/jsrsasign
// If someone manages to get this to work, please let me know (https://github.com/aneilbaboo)
declare module jsrsasign {
export interface RSAPublicKey
{
n_hex: string;
e_hex: string;
}