Skip to content

Instantly share code, notes, and snippets.

Avatar

Peter Jaszkowiak pitaj

View GitHub Profile
@pitaj
pitaj / ecmascript-rs.md
Last active Jan 16, 2020
ECMAScript/JavaScript tokenizers, lexers, parsers, tools, minifiers, compilers, etc in rust
View ecmascript-rs.md
  • 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
Repro for nodejs/node#9706 on windows (at least). Run like `node master 1111`. 3500 works for me, but 4000 will hang forever.
View master.js
'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 Oct 29, 2017
Demonstrate different error codes being thrown depending on platform when attempting to write to a read-only file
View eacces-eperm-inconsistency.js
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 Nov 21, 2016 — 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
View 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
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) {
You can’t perform that action at this time.