View .gitignore
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
node_modules |
View bigrams-to-pairs.js
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
// By Simon Lydell 2015. | |
// This file is in the public domain. | |
var stdin = require("get-stdin") | |
var tools = require("text-frequencies-analysis") | |
var helpers = require("text-frequencies-analysis/lib/helpers") | |
stdin(function(text) { | |
process.stdout.write(tools.jsonStringifyRow(convert(JSON.parse(text)))) | |
}) |
View zip.bash
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 bash | |
# Example: | |
# | |
# 1. git clone git@github.com:elm/core.git | |
# 2. cd core | |
# 3. ./zip.bash 1.0.5 out.zip elm/core | |
# 4. Compare outputs of: | |
# - `unzip -l out.zip` and `unzip -l github-zipball.zip` | |
# - `wc -c out.zip` and `wc -c github-zipball.zip` |
View tsconfig.json
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
Show hidden characters
{ | |
"compilerOptions": { | |
"allowSyntheticDefaultImports": true, | |
"esModuleInterop": true, | |
"forceConsistentCasingInFileNames": true, | |
"isolatedModules": true, | |
"module": "CommonJS", | |
"moduleResolution": "node", | |
"noEmit": true, | |
"noFallthroughCasesInSwitch": true, |
View ElmMakeError.ts
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 Decode from "tiny-decoders"; | |
import { ErrorTemplate, fancyError } from "./Errors"; | |
import { join, RESET_COLOR } from "./Helpers"; | |
import { NonEmptyArray } from "./NonEmptyArray"; | |
import { AbsolutePath, ElmJsonPath, OutputPath } from "./Types"; | |
// https://github.com/elm/compiler/blob/94715a520f499591ac6901c8c822bc87cd1af24f/compiler/src/Reporting/Doc.hs#L412-L431 | |
// Lowercase means “dull” and uppercase means “vivid”: | |
// https://github.com/elm/compiler/blob/94715a520f499591ac6901c8c822bc87cd1af24f/compiler/src/Reporting/Doc.hs#L369-L391 |
View pnr_check_digit.js
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
check = s => { let v = s.split("").map((c, i) => { let d = Number(c); let m = i % 2 === 0 ? d * 2 : d; return m > 9 ? m - 9 : m }).reduce((a, b) => a + b, 0); return (10 - (v % 10)) % 10} |
View .gitignore
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
node_modules |
View draw-rect.js
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
function draw(rect) { | |
const div = document.createElement("div"); | |
// Might be needed on crazy pages, but makes the console output for the div crazy large. | |
// div.style.all = "unset"; | |
div.style.position = "absolute"; | |
div.style.zIndex = "2147483647"; | |
// At least _try_ to scroll along. Won’t work for inner scroll. | |
div.style.left = `${window.scrollX + rect.left}px`; | |
div.style.top = `${window.scrollY + rect.top}px`; | |
div.style.width = `${rect.width}px`; |
View stable-sort.js
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
// 11 and 513 come from here: https://mathiasbynens.be/demo/sort-stability | |
function checkStable(length) { | |
return Array.apply(null, { length: length }) | |
.map(function (_, i) { | |
return i; | |
}) | |
.sort(function () { | |
return 0; | |
}) |
View .gitignore
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
bundle.js | |
node_modules |
NewerOlder