Skip to content

Instantly share code, notes, and snippets.

View samtstern's full-sized avatar
💭
🔥 Firebase-ing all over the GitHubs

Sam Stern samtstern

💭
🔥 Firebase-ing all over the GitHubs
  • Google
View GitHub Profile
@samtstern
samtstern / index.js
Created January 13, 2021 10:26
Firestore Bulk Writer Delete
const admin = require('firebase-admin');
// TODO(you): Change this to match your Project ID
admin.initializeApp({
projectId: "YOUR-PROJECT-ID"
});
const READ_BATCH_SIZE = 250;
const db = admin.firestore();
@samtstern
samtstern / MainActivity.java
Last active September 18, 2018 17:10
FirebaseUI-Android#1447
package com.firebase.example.firebaseui1447;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
@samtstern
samtstern / build.gradle
Created May 17, 2018 17:57
Google Services Plugin
android {
// ...
}
apply plugin: 'com.google.gms.google-services'
@samtstern
samtstern / AndroidManifest.xml
Created November 22, 2016 16:44
Invisible Activities
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.firebase.quickstart.invisibleactivitytest">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
//
// ViewController.swift
// testProjectforFirebase
//
// Created by Jacob Platin on 8/11/16.
// Copyright © 2016 Jacob Platin. All rights reserved.
//
import UIKit
import Firebase
@samtstern
samtstern / FirebaseImageLoader.java
Last active January 7, 2018 22:26
StorageReference + Glide
package com.firebase.ui.storage.images;
import android.util.Log;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.data.DataFetcher;
import com.bumptech.glide.load.model.stream.StreamModelLoader;
import com.google.android.gms.tasks.Tasks;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.StreamDownloadTask;
@samtstern
samtstern / HomeActivity.java
Created July 20, 2016 15:57
FirebaseRecyclerAdapter - ViewHolder with Context
public class HomeActivity extends Activity implements TodoListener {
private MyRecyclerAdapter mAdapter;
// ...
@Override
public void onCreate(Bundle savedInstanceState) {
// ...
@samtstern
samtstern / json_replace.py
Created August 26, 2014 16:36
Python JSON Tool for doog
import json
import sys
def main():
num_args = len(sys.argv)
if num_args < 4:
print 'Invalid arguments, should be <file> <key> <value>'
else:
file_name = sys.argv[1]