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
export type KeySet = Set<string> | |
const KeyListener = ({ | |
defaultText = 'Click Here', | |
keys, | |
setKeys | |
}: { defaultText?: string, keys: KeySet, setKeys: (args: KeySet) => void }) => { | |
const [prevKeys, setPrevKeys] = useState<KeySet>(new Set()) | |
const [currentKeys, setCurrentKeys] = useState<KeySet>(new Set()) | |
const [listening, setListening] = useState(false) | |
const prevKeysStr = prevKeys.size <= 0 ? 'Enter Key Combination' : [...prevKeys].join(', ') |
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
class ProbabilityMap { | |
constructor (map) { // map = {foo: 32, bar: 21} | |
this.calculateSize = () => { | |
let count = 0 | |
for (let [,value] of this.set) { | |
count += value | |
} | |
return count | |
} | |
this.set = map ? new Map(Object.entries(map)) : new Map() |
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
#!/usr/bin/env node | |
const fs = require('fs') | |
const acorn = require("acorn") | |
const glob = require('glob') | |
const getNextCharPosition = (idx, str, offset = 1, matchChar = ' ') => { | |
let i = idx | |
while (str[i] !== matchChar) { | |
i += offset | |
} |
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
const path = require('path') | |
const fs = require('fs') | |
const sharp = require('sharp') | |
const ShelfPack = require('@mapbox/shelf-pack') | |
const debug = process.env.DEBUG || false | |
const padding = +process.env.PADDING || 0 | |
const output = process.env.OUTPUT || 'out' | |
const dir = process.env.DIR || 'images' | |
const images = fs.readdirSync(dir).map(img => path.join(dir, img)) |
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
// @TODO: Read this to improve model http://www.roguebasin.com/index.php?title=Names_from_a_high_order_Markov_Process_and_a_simplified_Katz_back-off_scheme | |
const rand = (min, max) => ((Math.random() * max) + min) | 0 | |
class ProbabilityMap { | |
constructor (map) { // map = {foo: 32, bar: 21} | |
this.calculateSize = () => { | |
let count = 0 | |
for (let [,value] of this.set) { | |
count += value |
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
module.exports = { | |
secret: 'hellowthisismyskret', | |
port: process.env.PORT || 9001, | |
users: [['test', 'tester'], ['daniel', 'wordpass']] | |
} |
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
let path = require('path') | |
let HtmlWebpackPlugin = require('html-webpack-plugin') | |
module.exports = { | |
entry: './src/index.ts', | |
output: { | |
filename: 'out.js', | |
path: __dirname + '/dist' | |
}, |
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
18:37:01.628 INFO - Launching a Selenium Grid node | |
18:37:03.266 WARN - error getting the parameters from the hub. The node may end up with wrong timeouts.Connect to 172.17.0.2:4444 [/172.17.0.2] failed: Connection refused | |
Setting system property webdriver.chrome.driver to /usr/bin/chromedriver | |
Setting system property jna.debug_load to true | |
18:37:03.307 INFO - Java: Oracle Corporation 25.03-b03 | |
18:37:03.307 INFO - OS: Linux 4.4.12-boot2docker amd64 | |
18:37:03.322 INFO - v2.53.0, with Core v2.53.0. Built from revision 35ae25b | |
18:37:03.616 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: | |
registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform LINUX | |
18:37:03.624 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped: |