STAR_domainname_com.csrSTAR_domainname_com.pem
STAR_domainname_com.ca-bundleSTAR_domainname_com.crt
| # Allow non-root node to use ports 80 (HTTP) and 443 (HTTPS) | |
| sudo setcap 'cap_net_bind_service=+ep' $(which node) |
| const csv = require('csv-parser') | |
| const fs = require('fs') | |
| const patrons = []; | |
| const GENEROUS_PLEDGE = 30; | |
| const GENEROUS_LIFETIME = 200; | |
| fs.createReadStream(process.argv[2]) | |
| .pipe(csv()) | |
| .on('data', (data) => patrons.push(data)) |
| type AConstructorTypeOf<T> = new (...args:any[]) => T; |
| import { createSignal } from "./strong-signal" | |
| // declare the signal | |
| const onNumber = createSignal<(num: number) => void>(); | |
| // ok | |
| onNumber(function(num) {}); | |
| // compilation error! second argument not allowed | |
| onNumber(function(num, secondArg) {}); |
| -main Sandbox.hx | |
| -js Sandbox.js |
| interface Serializer<State, API= any> { | |
| getState() : State; | |
| getAPI() : API; | |
| } | |
| class MyAPI<State> { | |
| state: State; | |
| my() {} | |
| api() {} | |
| methods() {} |
| // npm install nanoid | |
| import * as generateId from "nanoid/generate"; | |
| class MyRoomHandler extends Room { | |
| onInit () { | |
| // this may introduce colliding `roomId`, use at your own risk | |
| this.roomId = generateId("1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ", 6); | |
| } | |
| } |
| export function* generateUserAgent() { | |
| let webkitVersion = 10; | |
| let chromeVersion = 1000; | |
| const so = [ | |
| 'Windows NT 6.1; WOW64', | |
| 'Windows NT 6.2; Win64; x64', | |
| "Windows NT 5.1; Win64; x64",, | |
| 'Macintosh; Intel Mac OS X 10_12_6', | |
| "X11; Linux x86_64", |
| ///<reference types="mocha" /> | |
| import { assert, expect } from "chai"; | |
| import { StateContainer, DataChange } from "../src"; | |
| function clone (data: any) { | |
| return JSON.parse(JSON.stringify(data)); | |
| } | |
| describe("StateContainer", () => { | |
| let container: StateContainer<any>; |