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
foo = '1' |
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
foo = '1' |
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 | |
} |
NewerOlder