Skip to content

Instantly share code, notes, and snippets.

Working on Firebase

David East davideast

Working on Firebase
View GitHub Profile

Firebase Hosting Deploy Single File

This utility script deploy a single local file to an existing Firebase Hosting site. Other files that are already deployed are left unmodified.

The difference with firebase deploy is that this script does not require you to have a local snapshot of all hosted files, you just need the one file that you want to add/update.


justinfagnani /
Last active Apr 21, 2022
Inline JavaScript Modules Definitions

Inline JavaScript Module Definitions


Domenic's blöcks proposal outlines a way to conveniently define functions that run in another worker/worklet as an inline, non-capturing scope, function body.

Blöcks as proposed have a few open questions and lack a few features that could generalize them to more use cases and with more practical ergonomics.

  • Blöcks don't allow static imports, which makes it harder for them to import neccessary library code. They must rely on dynamic import, which is somewhat more difficult to statically analyzer.
jasonaden / webpack.config.js
Created Oct 12, 2017
Importing from 'rxjs/operators'
View webpack.config.js
// Require the version of Rx you want to use (_esm5 or _esm2015)
const rxPaths = require('rxjs/_esm5/path-mapping');
var config = {
// Other config options...
resolve: {
extensions: [".ts", ".js"],
modules: [path.resolve('./src'), 'node_modules'],
// Use the "alias" key to resolve to an ESM distribution
paulirish /
Last active May 6, 2022
Evaluating overhead of performance.mark()

A few conversations have circled around user-side structural profiling. For context, see React PR #7549: Show React events in the timeline when ReactPerf is active

One particular concern is the measurement overhead. This gist has a benchmarking script (measure.js) for evaluating overhead and initial results.

Results: performance.mark()

Runs about 0.65µs per mark() call. Naturally, that's ~= an overhead of 1ms for 1500 mark()s. image

rauchg /
Last active Jan 30, 2022
btroncone /
Last active May 18, 2022
A Comprehensive Introduction to @ngrx/store - Companion to Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

View zip.js
function* zip(...iterables) {
let iterators = => i[Symbol.iterator]());
while (true) {
let entries = =>;
let done = entries.some(entry => entry.done);
if (done) break;
yield => e.value);
mikelehen / generate-pushid.js
Created Feb 11, 2015
JavaScript code for generating Firebase Push IDs
View generate-pushid.js
* Fancy ID generator that creates 20-character string identifiers with the following properties:
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
sararob /
Last active Aug 29, 2015
Apps & integrations built with the official HN API




mbbertino /
Last active Aug 29, 2015
Ember, Ember ClI, Emberfire, Firbase, Simple Login Example


##I wanted to throw out an example of using Ember, Ember CLI, Emberfire, Firebase, Firebase Simple Login to set up authenticiation, and redirecting.

A couple of setup tasks:

  1. Assuming you already have Ember CLI and have basic knowledge of Ember and Firebase
  2. npm install --save emberfire
  3. bower install --save emberfire
  4. bower install --save-dev firebase-simple-login
    And add "app.import('vendor/firebase-simple-login/firebase-simple-login.js'); " to your Brocfile.js