Skip to content

Instantly share code, notes, and snippets.

@airportyh
airportyh / example.ts
Last active June 4, 2020 21:43
TypeScript-based store implementation with type inference that works with StrictNullChecks turned on.
import { Store } from "./store";
interface IUser {
username: string;
}
interface IProduct {
name: string;
description?: string;
price: number;
@airportyh
airportyh / test-bug.js
Last active February 17, 2020 23:35
Test case for suspected reduce bug.
// Runtime functions
const $history = [];
let $historyCursor = -1;
let $stack = [];
let $nextHeapId = 1;
let $heap = {};
let $body = $nativeDomToVDom(document.body);
let $heapOfLastDomSync = $heap;
function $pushFrame(funName, variables) {
; This program asks the user for their age, and then
; calculates the year that they were born in and prints it out to the user.
SECTION .data
; these are string constants
ask_number db 'How old are you? '
answer db 'So you were born in '
SECTION .bss
; this buffer is used to store the user's input, which are expected to be all digits
section .data
question: db "Are you sure? (y/n)", 10
affirmative: db "Okay, fine.", 10
negative: db "Nevermind, then.", 10
section .bss
input: resb 255
section .text
global _start
import { Subject, BehaviorSubject, Observable } from "rxjs";
const subject: Observable<string> = new BehaviorSubject("Hello");
subject.subscribe((value) => {
console.log("1st sub: received value", value);
});
subject.next("How are you doing?");
subject.next("Goodbye");
{
"curly": true,
"eqeqeq": true,
"latedef": true,
"unused": true,
"undef": true,
"proto": true,
"debug": true,
"esversion": 6,

Firebase 1 Exercises

Correction: during our lesson, we saw that the UPDATE verb did not work. This is because UPDATE is not a valid verb in the HTTP protocol: it should have been PUT. Replacing UPDATE with PUT fixed the problem. Which also means my slide was wrong.

You will create a user interface for someone to create and manage a number of Doctor Who TV episodes. The information will be persisted in a Firebase database.

This file has been truncated, but you can view the full file.
/*!
* jQuery JavaScript Library v3.1.1
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
This file has been truncated, but you can view the full file.
/*!
* jQuery JavaScript Library v3.1.1
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
This file has been truncated, but you can view the full file.
/**
* @license AngularJS v1.5.5
* (c) 2010-2016 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window) {'use strict';
/**
* @description
*