Skip to content

Instantly share code, notes, and snippets.

Lenin Raj Rajasekaran emaillenin

Block or report user

Report or block emaillenin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
emaillenin /
Created Dec 16, 2017
Branch Analytics and Referral Tracking for Custom APK files
public void onStart() {
Branch branch = Branch.getInstance();
branch.initSession(new Branch.BranchReferralInitListener() {
public void onInitFinished(JSONObject referringParams, BranchError error) {
if (error == null) {
// params are the deep linked params associated with the link that the user clicked -> was re-directed to this app
emaillenin /
Created Dec 11, 2016
Download APK using DownloadManager and start installation automatically - Android 7.0 Nougat compatible
public void downloadUpdate() {
DownloadManager dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
String destination = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/";
String fileName = "your_app.apk";
destination += fileName;
final Uri uri = Uri.parse("file://" + destination);
File file = new File(destination);
if (file.exists())
View hyper.js
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.75)',
emaillenin / Steps.txt
Created Jul 1, 2014
Working with a forked Github project
View Steps.txt
1. Fork the project
2. git clone <your-forked-repo>
3. Add a new remote of the original repo
4. Pull changes from original repo frequently and rebase against your local
5. Push changes to your repo
6. Create pull create and send it to the original repo!


A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

emaillenin /
Last active Aug 29, 2015
# Inspired from
export PS_COLOR="0;32"
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
emaillenin / remove_brace.rb
Created Mar 9, 2014
Removes the opening and the closing brace using regex
View remove_brace.rb
"(hey there!)".gsub(/^\(|\)$/,'')
emaillenin / columns_accessed_recently.sql
Created Dec 12, 2013
Finds the columns that has been recently accessed in Teradata
View columns_accessed_recently.sql
select ObjectColumnName from dbc.dbqlobjtbl a
join dbc.dbqlogtbl b on a.ProcID = b.ProcID
and a.QueryID = b.QueryID
where ObjectDatabaseName = 'database_name' and ObjectTableName = 'table_name' and statementtype = 'Select' and ObjectType = 'Col'
emaillenin /
Created Aug 4, 2013
Creating a remote git repository
cd git-repo-dir
mkdir repo-name
cd repo-name
git init --bare
cd ..
chown -R gituser:gituser repo-name
/** In Git GUI, add a remote repo with URL as **/
emaillenin / convertNumberToWordsForIndia9Digits.vb
Last active Dec 15, 2015
Converts a number (a currency) into words for Indian Format.. Supports upto 9 Digits.
View convertNumberToWordsForIndia9Digits.vb
Public Function convertNumberToWordsForIndia9Digits(ByVal number As Decimal)
'Based on this -
'If you know the C# version, share it here
Dim words As New Hashtable
words.Add("0", "")
words.Add("1", "One")
words.Add("2", "Two")
words.Add("3", "Three")
words.Add("4", "Four")
words.Add("5", "Five")
You can’t perform that action at this time.