Skip to content

Instantly share code, notes, and snippets.

View origin1tech's full-sized avatar

Origin1 Tech origin1tech

View GitHub Profile
@origin1tech
origin1tech / uid.ts
Last active January 28, 2023 13:13
JavaScript Firebase UID Generation
export interface IUID {
generate(): string;
timestamp(uid: string, asDate?: boolean): number | Date;
}
/**
* SEE --> https://gist.github.com/mikelehen/3596a30bd69384624c11
*
@origin1tech
origin1tech / oauthredirect.js
Created October 8, 2015 20:33
Firebase OAuth Redirect
// Custom connection class to obtain root conneciton.
var conn = new FirebaseConnection('auchat');
// conn returns the connection class instance
// of which contains a property called "root"
// which is the Firebase root ref.
conn.root.onAuth(function(authData) {
if (authData !== null) {
console.log("Authenticated successfully with payload:", authData);