This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Generators are kind of confusing, so here's place to start. | |
*/ | |
import { strict as assert } from "assert" | |
import { describe, it } from "mocha" | |
function run<T>( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { strict as assert } from "assert" | |
// Using a strategy similar to the Selenium Framework: | |
// https://gist.github.com/ccorcos/5372e1f946927d5043f070fb9260fcea | |
// ============================================================================ | |
// Remote API | |
// ============================================================================ | |
// Types that define the procedures in the remote process. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { strict as assert } from "assert" | |
import EventEmitter from "events" | |
import { describe, it } from "mocha" | |
import { IPCPeer } from "./IPCPeer" | |
function setupPeers< | |
A2B extends AnyFunctionMap = AnyFunctionMap, | |
B2A extends AnyFunctionMap = AnyFunctionMap | |
>() { | |
const aEvents = new EventEmitter() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This object encapsulates the state and dispatches events. | |
class Store<T> { | |
constructor(public state: T) {} | |
public setState = (nextState: T) => { | |
this.state = nextState | |
this.emit() | |
} |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/C/j/js-avl-tree ❯❯❯ node --trace-gc build/bench/treedb.js | |
[81445:0x103b26000] 42 ms: Scavenge 2.5 (4.2) -> 2.2 (5.2) MB, 0.8 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure | |
[81445:0x103b26000] 52 ms: Scavenge 2.8 (5.2) -> 2.7 (6.2) MB, 0.9 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure | |
[81445:0x103b26000] 77 ms: Scavenge 4.0 (6.2) -> 3.9 (9.2) MB, 0.5 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure | |
starting | |
0 | |
[81445:0x103b26000] 176 ms: Scavenge 6.6 (11.2) -> 5.6 (12.2) MB, 0.6 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure | |
[81445:0x103b26000] 184 ms: Scavenge 7.1 (12.2) -> 5.7 (12.7) MB, 0.5 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure | |
[81445:0x103b26000] 191 ms: Scavenge 7.6 (12.7) -> 5.9 (16.7) MB, 0.5 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure | |
[81445:0x103b26000] 206 ms: Scavenge 9.7 (16.7) -> 6.3 (16.7) MB, 0.5 / 0.0 ms (ave |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ============================================================================= | |
Selenium Framework | |
Example: | |
``` | |
it("browser test", async () => { | |
await withBrowser(async browser => { | |
await browser.visit("/login") | |
await browser.clickText("Login with email") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as _ from "lodash" | |
/** This is how DataTypes are serialized. */ | |
export type DataType = | |
| { type: "string" } | |
| { type: "number" } | |
| { type: "boolean" } | |
| { type: "literal"; value: string | number | boolean } | |
| { type: "array"; inner: DataType } | |
// Tuple types are not quite working yet. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯❯❯ ios_webkit_debug_proxy -d | |
ss.add_server_fd(3) | |
Listing devices on :9221 | |
ss.add_fd(4) | |
ss.add_server_fd(5) | |
ss.remove_server_fd(5) | |
ss.recv fd=4 len=981 | |
ss.add_server_fd(5) | |
ss.add_fd(9) | |
wi.send_packet[174]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯❯❯ ios_webkit_debug_proxy -d | |
ss.add_server_fd(3) | |
Listing devices on :9221 | |
ss.add_fd(4) | |
ss.add_server_fd(5) | |
ss.remove_server_fd(5) | |
ss.recv fd=4 len=981 | |
ss.add_server_fd(5) | |
ss.add_fd(9) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.demo.daemon.plist</string> | |
<key>RunAtLoad</key> | |
<true/> |
NewerOlder