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
#!/usr/bin/env python3 | |
import string | |
import random | |
from hashlib import md5 | |
import struct | |
import sys | |
from bisect import bisect_left | |
import time | |
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
scope = [] | |
enter = -> | |
scope.push([]) | |
scope[scope.length - 1] | |
leave = -> | |
scope.pop() | |
scope[scope.length - 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
package main | |
import ( | |
"fmt" | |
"github.com/sergi/go-diff/diffmatchpatch" | |
) | |
const ( | |
src = "Hello world!" |
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
function compile(template) { | |
function expandFilter(expr) { return expr.replace(/^(.+?)(?:|(\|[^()]+))?$/, function ($0, expr, filters) { | |
if (!filters) return expr; | |
filters = filters.split(/\s*\|\s*/g).reverse(); | |
return filters.join('(') + '(' + expr + filters.map(function () { return ')'; }).join(''); | |
}); } | |
return new Function( | |
'with(this){with(arguments[0]){var out="' + | |
template.replace(/\\([@{}\\])|\{\{\s*([^]+?)\s*\}\}|^\s*@\s*(.+)|([^])/gm, | |
function ($0, escaped, expr, stat, ch) { |