Skip to content

Instantly share code, notes, and snippets.

View pitaj's full-sized avatar

Peter Jaszkowiak pitaj

View GitHub Profile
@pitaj
pitaj / ecmascript-rs.md
Last active May 2, 2024 18:22
ECMAScript/JavaScript tokenizers, lexers, parsers, tools, minifiers, compilers, etc in rust
  • spdy web compiler swc is rust port of babel and closure compiler.
  • ratel High performance JavaScript to JavaScript compiler with a Rust core
  • RESS Rusty EcmaScript Scanner
  • RESSA Rust EcmaScript Syntax Analyzer
  • rjs An implementation of ECMAScript 5.1, in Rust. Work in progress.
  • espadon EcmaScript parser writter in Rust (WIP)
  • tyrion EcmaScript 6 parser written in Rust.
  • esprit A JavaScript parser written in Rust
  • j8t
@pitaj
pitaj / master.js
Created May 30, 2018 02:31
Repro for nodejs/node#9706 on windows (at least). Run like `node master 1111`. 3500 works for me, but 4000 will hang forever.
'use strict';
const { fork } = require('child_process');
const { join } = require('path');
const count = process.argv[2] * limit;
// number of cores on your machine - 1
// or whatever you want \_(*_*)_/
const limit = 7;
@pitaj
pitaj / eacces-eperm-inconsistency.js
Created October 29, 2017 20:42
Demonstrate different error codes being thrown depending on platform when attempting to write to a read-only file
const fs = require('fs');
const path = require('path');
const code = '444';
const filename = '00000';
const content = 'abcdefghijklmnopqrstuvwxyz';
const filePath = path.join(__dirname, filename);
// set up a read-only file
fs.writeFileSync(filePath, content);
@pitaj
pitaj / Get the first commit url.js
Last active November 21, 2016 04:08 — forked from JamesWP/Get the first commit url.js
A snippet using the github public api to get the url and sha of the first commit for a given repo
// A snippet using the github public api to get
// the url and sha of the first commit for a given repo
function openFirstCommit(userorg, repo) {
return fetch('https://api.github.com/repos/'+userorg+'/'+repo+'/commits')
// the link header has additional urls for paging
// parse the original JSON for the case where no other pages exist
.then(res => Promise.all([res.headers.get('link'), res.json()]))
.then(([link, commits]) => {
if (link) {