Skip to content

Instantly share code, notes, and snippets.

Avatar

Ashwin Raghav ashwinraghav

View GitHub Profile
@ashwinraghav
ashwinraghav / get_user.py
Last active Oct 17, 2017
Get firebase user by phone number
View get_user.py
import firebase_admin
from firebase_admin import auth
from firebase_admin import credentials
cred = credentials.Certificate("path to service_account.json")
firebase_admin.initialize_app(cred)
user = auth.get_user_by_phone_number("your_phone")
print 'Successfully fetched user data: {0}'.format(user.uid)
@ashwinraghav
ashwinraghav / server side
Last active May 10, 2016
buzzfeed-digits auth snippets
View server side
func getDigitsAuthInfo(success:((info:NSDictionary)->()), failure:((error:NSError) ->())) {
let digitsAppearance = DGTAppearance()
// Change color properties to customize the look:
digitsAppearance.backgroundColor = kCuteYellowColor
digitsAppearance.accentColor = kCuteRedColor
let digits = Digits.sharedInstance()
digits.authenticateWithDigitsAppearance(digitsAppearance, viewController: nil, title: nil, completion: { (session, err) in
if (err == nil) {
let sessionDict = NSMutableDictionary(capacity: 8)
let oauthSigning = TWTROAuthSigning(authConfig: Twitter.sharedInstance().authConfig, authSession: session)
@ashwinraghav
ashwinraghav / gist:9d7c4c4d2f7e6ff44da6
Created Jul 28, 2014
YARN Client Advanced Configuration Snippet (Safety Valve) for yarn-site.xml
View gist:9d7c4c4d2f7e6ff44da6
<property>
<name>yarn.scheduler.minimum-allocation-mb</name>
<value>1024</value>
</property>
<property>
<name>yarn.scheduler.maximum-allocation-mb</name>
<value>16384</value>
</property>
@ashwinraghav
ashwinraghav / mapred-site.xml
Created Jul 28, 2014
MapReduce Client Advanced Configuration Snippet (Safety Valve) for mapred-site.xml
View mapred-site.xml
<property>
<name>mapreduce.map.memory.mb</name>
<value>4096</value>
</property>
<property>
<name>mapreduce.reduce.memory.mb</name>
<value>6144</value>
</property>
<property>
<name>mapreduce.map.java.opts</name>
@ashwinraghav
ashwinraghav / ftp_sync.coffee
Created Oct 4, 2012 — forked from samcday/ftp_sync.coffee
Easy-mode dev work to remote server!
View ftp_sync.coffee
require "sugar"
async = require "async"
fs = require "fs"
path = require "path"
child_process = require "child_process"
FTPClient = require "./ftp"
[watchPath, ftpHost, ftpUser, ftpPass, ftpPath] = process.argv.from 2
conn = new FTPClient