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 peg from "peggy-tag"; | |
const PLACEHOLDER = "{{{ARG}}}"; | |
const parse = peg` | |
{{ | |
function add(left, right) { | |
if (typeof left === 'number') { | |
if (typeof right === 'number') { | |
return left + right; |
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
{{ | |
// The signed representation of the numerical value zero shall contain a PLUS | |
// SIGN or a SPACE, but not a MINUS SIGN. | |
const NZERO1 = /^-0+$/ | |
// The signed representation of the numerical value zero shall contain a PLUS | |
// SIGN or a SPACE, but not a MINUS SIGN. | |
const NZERO2 = /^-0*\.0*$/ | |
// If the exponent has the value Zero, its sign shall be a PLUS SIGN. |
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
// Compress a given string using the lzma program, and return the compressed contents. | |
const { spawn } = require('child_process') | |
const compress = str => new Promise((resolve, reject) => { | |
const lzma = spawn('cat', | |
{ stdio: ["pipe", "pipe", "inherit"] }) |
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
/* eslint-disable no-console */ | |
import { Benchmark } from 'kelonio' | |
import { parse } from './iniFile' | |
import { parse_to_json } from './one-ini/editorconfig_ini' | |
import { promises as fs } from 'fs' | |
import * as path from 'path' | |
interface WasmParseResults { | |
version: string | |
body?: (WasmPair | WasmComment | WasmSection)[] |
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
known_ships = [ | |
["Cruiser", 3], | |
["Submarine", 2] | |
] | |
cells = [] | |
%w( A B C D ).each do |x| | |
(1..4).each do |y| | |
cells << "#{x}#{y}" | |
end |
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
'use strict' | |
/** | |
* Is the given thing iterable? | |
* | |
* @static | |
* @param {any} g - the thing to check | |
* @returns {boolean} - true if `g` looks like an iterable | |
*/ | |
function isIterable(g) { |
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
'use strict' | |
const req = require('esm')(module) | |
const {Combination} = req('js-combinatorics') | |
const a = Array.from(new Array(200), (_, i) => i) | |
let tot = 0 | |
for (const [x, y, z] of Combination.of(a, 3)) { | |
tot += x*y*z | |
} |
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
defaults write com.adiumX.adiumX AIEnableDebugLogging -bool YES |
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
$ tokei . -e third_party -s lines | |
-------------------------------------------------------------------------------- | |
Language Files Lines Code Comments Blanks | |
-------------------------------------------------------------------------------- | |
C++ 10956 5753882 4411352 595301 747229 | |
JavaScript 58163 5690253 3657219 1214057 818977 | |
HTML 66717 3471374 3005413 130585 335376 | |
C Header 13935 2871337 1710080 754980 406277 | |
C 2999 2112200 1514317 351977 245906 | |
JSON 1174 1162180 1162180 0 0 |
NewerOlder