Skip to content

Instantly share code, notes, and snippets.

View erezsh's full-sized avatar

Erez Shinan erezsh

View GitHub Profile
function downloadToFile(content, filename, contentType) {
const a = document.createElement('a');
const file = new Blob([content], {type: contentType});
a.href= URL.createObjectURL(file);
a.download = filename;
a.click();
URL.revokeObjectURL(a.href);
};
@erezsh
erezsh / JSONLexer.py
Created December 13, 2021 08:54
Parsers used for Lark benchmarks
# Generated from JSON.g4 by ANTLR 4.7.1
# encoding: utf-8
from __future__ import print_function
from antlr4 import *
from io import StringIO
import sys
def serializedATN():
with StringIO() as buf: