Skip to content

Instantly share code, notes, and snippets.

We can't make this file beautiful and searchable because it's too large.
date,postcode,New Cases in Last 3 Days,New Cases in Last 7 Days,Total Cases
2020-01-22T11:00:00.000+11:00,2134,1,1,1
2020-01-22T11:00:00.000+11:00,2121,0,0,0
2020-01-22T11:00:00.000+11:00,2033,0,0,0
2020-01-22T11:00:00.000+11:00,2071,0,0,0
2020-01-22T11:00:00.000+11:00,2010,0,0,0
2020-01-22T11:00:00.000+11:00,2073,0,0,0
2020-01-22T11:00:00.000+11:00,2070,0,0,0
2020-01-22T11:00:00.000+11:00,2077,0,0,0
2020-01-22T11:00:00.000+11:00,2022,0,0,0
const longLived = new LongLived();
let sum = 0;
for (let i = 0; i < 100; ++i) {
const shortLived = new ShortLived(longLived);
sum += shortLived.bar;
shortLived.dispose();
}
console.log(sum);
class ShortLived {
@observable
private isDisposed = false;
constructor(readonly longLived) {
this.longLived = longLived;
}
@computed({ keepAlive: true })
get bar() {
@computed({ keepAlive: true })
get bar() {
return this.longLived.foo * 2;
}
class LongLived {
@observable
foo = 5;
}
import { observable, computed } from "mobx";
class LongLived {
@observable
foo = 5;
}
class ShortLived {
constructor(readonly longLived) {
this.longLived = longLived;
@kring
kring / gltf.json
Last active June 13, 2019 06:02
Example of a glTF model in TerriaJS
{
"catalog": [
{
"name": "Skinned glTF Model",
"type": "gltf",
"url": "https://s3-ap-southeast-2.amazonaws.com/static.map.terria.io/data/Cesium_Man.glb",
"origin": {
"longitude": 151.215,
"latitude": -33.861,
"height": 36.0
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
LGA_CODE_2016
16350
interface Test {
foo: number;
bar?: number;
baz: number | undefined;
}
type TestWithAllFields = Complete<Test>;
// TestWithAllFields is equivalent to:
// interface TestWithAllFields {
type Complete<T> = {
[P in keyof Required<T>]: Pick<T, P> extends Required<Pick<T, P>> ? T[P] : (T[P] | undefined);
}