Skip to content

Instantly share code, notes, and snippets.

@KonradHoeffner
KonradHoeffner / paperdiff
Created January 23, 2024 14:23
visualize LaTeX PDF change result
cp paper.pdf old.pdf && tectonic paper.tex && diffpdf old.pdf paper.pdf
@KonradHoeffner
KonradHoeffner / pacman_packages_description.sh
Created October 28, 2021 09:30
List all packages explicitily installed with pacman along with their description
pacman -Qe | cut -f1 -d " " > /tmp/names
pacman -Qe | cut -f1 -d " " | xargs -I @ pacman -Qi @ | grep Description | cut -f2 -d ":" > /tmp/desc
pr -m -t -w 200 /tmp/names /tmp/desc | sed -r "s/ {8}//"
=IFERROR(JOIN(",",ARRAYFORMULA(VLOOKUP(SPLIT(D2,",")&"",{ImportRange("1F0Rg1bbqYiZZEXL3DnyDjEZo-eexr7_HJk4eqtyx42Y","all!A2:B199"),$D$2:$D$199},2,false))),"")
@KonradHoeffner
KonradHoeffner / why42.sh
Created August 15, 2019 08:32
Why does this produce 42?
echo {1,2,3}\\n | xargs -I @ sh -c "echo {2,3,4}^M | xargs -I E echo @ E"
CONSTRUCT {?s rdfs:label ?l.}
FROM <tmp>
{
?s ?p ?o.
FILTER NOT EXISTS {?s rdfs:label ?label}
FILTER(!isBlank(?s))
FILTER(STRSTARTS(STR(?s),"http://hitontology.eu/ontology/"))
bind(STRLANG(
REPLACE(
REPLACE(
SELECT id_to_iri(RGGM_GROUP_IID), id_to_iri(RGGM_MEMBER_IID) FROM RDF_GRAPH_GROUP_MEMBER;
DB.DBA.RDF_GRAPH_GROUP_DROP('http://www.snik.eu/ontology',0);
DB.DBA.RDF_GRAPH_GROUP_CREATE('http://www.snik.eu/ontology',0);
DB.DBA.RDF_GRAPH_USER_PERMS_SET ('http://www.snik.eu/ontology', 'nobody', 1);
DB.DBA.RDF_GRAPH_GROUP_INS('http://www.snik.eu/ontology','http://www.snik.eu/ontology/bb');
DB.DBA.RDF_GRAPH_GROUP_INS('http://www.snik.eu/ontology','http://www.snik.eu/ontology/ob');
DB.DBA.RDF_GRAPH_GROUP_INS('http://www.snik.eu/ontology','http://www.snik.eu/ontology/ciox');
DB.DBA.RDF_GRAPH_GROUP_INS('http://www.snik.eu/ontology','http://www.snik.eu/ontology/he');
DB.DBA.RDF_GRAPH_GROUP_INS('http://www.snik.eu/ontology','http://www.snik.eu/ontology/it');
DB.DBA.RDF_GRAPH_GROUP_INS('http://www.snik.eu/ontology','http://www.snik.eu/ontology/it4it');
DB.DBA.RDF_GRAPH_GROUP_INS('http://www.snik.eu/ontology','http://www.snik.eu/ontology/limes-exact');
select replace(str(?c1),".*/","") as ?ciox replace(str(?c2),"http://www.snik.eu/ontology/","") as ?other str(sample(?d)) as ?definition
{
graph <http://www.snik.eu/ontology/ciox> {?c1 a owl:Class.}
?c2 a owl:Class.
filter(?c1!=?c2)
?c1 rdfs:label ?l.
?c2 rdfs:label ?l.
?c2 skos:definition ?d.
filter(str(?d)=!"")
}
function mergeJsonArraysByKey(a1,a2)
{
const map1 = new Map();
const map2 = new Map();
for(let i=0;i<a1.length;i++)
{
if(a1[i].selector)
{
map1.set(a1[i].selector,a1[i]);
}
select ?class
FROM <http://www.snik.eu/ontology>
{
?class a owl:Class.
filter not exists {?x ov:defines ?class.}
}