Skip to content

Instantly share code, notes, and snippets.

View c0deaddict's full-sized avatar

Jos van Bakel c0deaddict

View GitHub Profile
@dshnkao
dshnkao / umenu
Last active September 20, 2024 16:30
open firefox history using fzf or rofi
#!/usr/bin/env bash
# Relying on rofi / fzf is a bit limited
# e.g
# umenu "places.sqlite" "rofi -dmenu --no-sort"
# umenu "places.sqlite" "fzf --no-sort --exact"
DB_PATH=${1:?ARG 1: path to firefox database}
ometa PrologTranslator : Parser {
variable ::= <spaces> <firstAndRest #upper #letterOrDigit>:name => [Var new: (name join: '')].
symbol ::= <spaces> <firstAndRest #lower #letterOrDigit>:name => [Sym new: (name join: '')].
clause ::= <symbol>:sym <token '('> <listOf #expr ','>:args <token ')'> => [Clause new: sym : args].
expr ::= <clause> | <variable> | <symbol>.
clauses ::= <listOf #clause ','>.
rule ::= <clause>:head <token ':-'> <clauses>:body <token '.'> => [Rule new: head : body]
| <clause>:head <token '.'> => [Rule new: head : {}].
rules ::= <rule>*:rs <spaces> <end> => [rs].
query ::= <clause>:c <spaces> <end> => [c].