Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
namespace FauxCombinator
{
public abstract class Parser<T>
{
protected (T, string) parseSeparatedBy(string text, string sep, Func<string, (T, string)> subparse, Func<List<T>, T> ctor)
{
var nodes = new List<T>();
package.path = package.path .. ";../?/init.lua;../?.lua"
require "PLoop"(function (_ENV)
class "__State_Machine__" (function(_ENV)
extend "IApplyAttribute"
function ApplyAttribute(self, target, targettype, manager, owner, name, stack)
if manager then
Environment.Apply(manager, function(_ENV)
property "State" { default = self.State }
@vendethiel
vendethiel / dart.lisp
Created April 20, 2021 21:03
Not a very good implementation of a not very impressive feature
(defmacro dart (&rest xs)
(flet ((wrap (x) (if (and (consp x) (eq 'if (car x)))
`(if ,(cadr x) (list ,(caddr x)))
`(list ,x))))
`(mapcan #'identity (list ,@(mapcar #'wrap xs)))))
(princ (list-length (dart
1
(if t 0))))
class X::DivideByZero is Exception {}
class X::UnknownRestart is Exception {
has $.name;
method message { "Unknown restart: $.name" }
}
my %*BOUND;
sub restart-case(Code $code, *%handlers) {
func tag(x) {
return func show(n) {
say("hello: " ~ x ~ "!");
}
}
say("[ simple test ]");
my node = quasi { say(""); };
walk(node, [
#[Q, tag("Q")],
dupe for Admin Upload Utility : 4238 and 7144 and 6988 and 4228 and 7092
dupe for Avatar Generator : 5006 and 6516
dupe for Azerbaijani Language Pack : 6790 and 7760
dupe for Blank Page Template : 1945 and 3562
dupe for Disable Registration : 3270 and 6147
dupe for Easy Online/Offline When Viewing Topic : 5464 and 5464
dupe for Gender Hack : 182 and 7692
dupe for Guestbook : 4597 and 7587
dupe for External Forum Redirect : 1810 and 1810
dupe for Photo Album Add-on : 1603 and 1719 and 1319 and 2356 and 1155 and 1352
use v6;
# todo parse table somehow
say '<meta charset="UTF-8"><style>.elem { background-color: red; }</style>';
# Hard (d, h, ch, k, n, r, t)
# Soft (č, ř, š, ž, c, j, ď, ť, ň)
my @headers = <<
'Masculine Animate (Hard)'
'Masculine Inanimate (Hard)'
@vendethiel
vendethiel / lb.js
Last active March 24, 2019 17:36 — forked from abrudz/lb.js
APL language bar
;(_=>{
let hc={'<':'&lt;','&':'&amp;',"'":'&apos;','"':'&quot;'},he=x=>x.replace(/[<&'"]/g,c=>hc[c]) //html chars and escape fn
,tcs='<-←xx×/\\×:-÷*O⍟[-⌹-]⌹OO○77⌈FF⌈ll⌊LL⌊|_⊥TT⊤-|⊣|-⊢=/≠L-≠<=≤<_≤>=≥>_≥==≡=_≡/_≢L=≢vv∨^^∧^~⍲v~⍱^|↑v|↓((⊂cc⊂(_⊆))⊃[|⌷|]⌷A|⍋V|⍒ii⍳i_⍸ee∊e_⍷'+
'uu∪UU∪nn∩/-⌿\\-⍀,-⍪rr⍴pp⍴O|⌽O-⊖O\\⍉::¨""¨~:⍨~"⍨*:⍣*"⍣oo∘o:⍤o"⍤[\'⍞\']⍞[]⎕[:⍠:]⍠[=⌸=]⌸[<⌺>]⌺o_⍎oT⍕o-⍕<>⋄on⍝->→aa⍺ww⍵VV∇--¯0~⍬'+
'^-∆^=⍙[?⍰?]⍰:V⍢∇"⍢||∥ox¤)_⊇_)⊇O:⍥O"⍥V~⍫\'\'`'
,lbs=['←←\nASSIGN',' ','++\nconjugate\nplus','--\nnegate\nminus','××\ndirection\ntimes','÷÷\nreciprocal\ndivide','**\nexponential\npower','⍟⍟\nnatural logarithm\nlogarithm',
'⌹⌹\nmatrix inverse\nmatrix divide','○○\npi times\ncircular','!!\nfactorial\nbinomial','??\nroll\ndeal',' ','||\nmagnitude\nresidue',
'⌈⌈\nceiling\nmaximum','⌊⌊\nfloor\nminimum','⊥⊥\ndecode','⊤⊤\nencode','⊣⊣\nsame\nleft','⊢⊢\nsame\nright',' ','==\nequal','≠≠\nnot equal',
'≤≤\nless than or equal to','<<\nless than','>>\ngreater than','≥≥\ngreater than or equal to','≡≡\ndepth\nmatch','≢≢\ntally\nnot matc
@vendethiel
vendethiel / main.p6
Created October 15, 2018 13:25 — forked from pmurias/main.p6
Hello World
say("Hello World");
Advanced SQL
<https://www.slideshare.net/MarkusWinand/modern-sql?ref=https://modern-sql.com/slides>
slide 3: `LATERAL`
slide 12: `GROUPING SETS`
slide 19: `WITH`
slide 45: `WITH RECURSIVE`
slide 71: `FILTER`
slide 75: `PARTITION BY`, `OVER` (/`OVER ORDER BY`)
slide 105: `WITHIN GROUP`