Skip to content

Instantly share code, notes, and snippets.

Kirsten’s favourite cake: 6 Oz stork 6 Oz caster sugar -x 4.5 Oz dove gf flour -x 1.5 Oz bourneville cocoa -x 1/8 teaspoon xanthan

3 eggs If the flour was plain (not self raising) add 2 tsps baking powder After mixing it all up I have started adding some cold water. 1 or 2 teaspoons? That makes the cake rise evenly

0
1
2
3
4
5
6
7
8
9
@JakeChampion
JakeChampion / results.md
Last active April 27, 2022 16:07
c@e js perf

Here are some results on the bench-v8 version 7 benchmark.

We did not run Splay as that uses more memory than c@e permits.

The programs were executed using Viceroy. They were run on a MacBook Pro 13inch, 2019, Core i7 @ 2.8GHz, 16 GB 2133 MHz LPDDR3.

Engine QuickJS C@E SpiderMonkey C@E
Executable size 3.9M 9.4M
Richards 112 36.8
@JakeChampion
JakeChampion / json-stringify-circular-replacer.js
Created July 15, 2020 10:57
replacer function for json.stringify to change circular references
function circularReferenceReplacer () {
const seen = new WeakMap();
return (key, value) => {
if (typeof value === "object" && value !== null) {
if (seen.has(value)) {
let path = seen.get(value);
if (path === "") {
path = "the root object";
}
return 'circular reference which points to ' + path + '.';
@JakeChampion
JakeChampion / containsCircularPaths.js
Last active July 15, 2020 11:10
Used to find out whether an object contains a circular reference.
/**
* Used to find out whether an object contains a circular reference.
* @param {*} rootObject The object we want to search within for circular references
* @returns {bool} Returns true if a circular reference was found, otherwise returns false
*/
function containsCircularPaths(rootObject) {
// Used to keep track of all the values the rootObject contains
const traversedValues = new WeakSet();
/**