Skip to content

Instantly share code, notes, and snippets.

View ashwinraghav's full-sized avatar

Ashwin Raghav ashwinraghav

View GitHub Profile
@ashwinraghav
ashwinraghav / components.java
Created January 28, 2023 05:35
Composable Libraries
@Keep
public class AbtRegistrar implements ComponentRegistrar {
private static final String LIBRARY_NAME = "fire-abt";
@Override
public List<Component<?>> getComponents() {
return Arrays.asList(
Component.builder(AbtComponent.class)
.name(LIBRARY_NAME)
.add(Dependency.required(Context.class))
@ashwinraghav
ashwinraghav / get_user.py
Last active October 17, 2017 23:24
Get firebase user by phone number
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 06:38
buzzfeed-digits auth snippets
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 July 28, 2014 11:50
YARN Client Advanced Configuration Snippet (Safety Valve) for yarn-site.xml
<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 July 28, 2014 11:42
MapReduce Client Advanced Configuration Snippet (Safety Valve) for 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 October 4, 2012 05:32 — forked from samcday/ftp_sync.coffee
Easy-mode dev work to remote server!
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