Skip to content

Instantly share code, notes, and snippets.

View davideast's full-sized avatar
💜
Working on Project IDX (and Firebase too)

David East davideast

💜
Working on Project IDX (and Firebase too)
View GitHub Profile
@puf
puf / README.md
Last active March 28, 2023 16:37
Firebase Hosting Deploy Single File

This script may no longer work. Have a look at its (more official) replacement: https://github.com/firebase/firebase-tools/tree/master/scripts/examples/hosting/update-single-file

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
justinfagnani / README.md
Last active April 21, 2022 08:45
Inline JavaScript Modules Definitions

Inline JavaScript Module Definitions

Motivation

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
jasonaden / webpack.config.js
Created October 12, 2017 17:22
Importing from 'rxjs/operators'
// 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
paulirish / intro.md
Last active January 14, 2024 13:24
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
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@btroncone
btroncone / ngrxintro.md
Last active February 9, 2024 15:37
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

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

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

Table of Contents

function* zip(...iterables) {
let iterators = iterables.map(i => i[Symbol.iterator]());
while (true) {
let entries = iterators.map(i => i.next());
let done = entries.some(entry => entry.done);
if (done) break;
yield entries.map(e => e.value);
}
}
@mikelehen
mikelehen / generate-pushid.js
Created February 11, 2015 17:34
JavaScript code for generating Firebase Push IDs
/**
* 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
sararob / hn-api-examples.md
Last active August 29, 2015 14:07
Apps & integrations built with the official HN API

Integrations

Apps

Angular

@mbbertino
mbbertino / 1intro.md
Last active August 29, 2015 14:06
Ember, Ember ClI, Emberfire, Firbase, Simple Login Example

#Hello!

##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