Skip to content

Instantly share code, notes, and snippets.

View white-gecko's full-sized avatar

Natanael Arndt white-gecko

View GitHub Profile
@white-gecko
white-gecko / dataset-construct-literal.sparql
Last active November 13, 2019 19:01
If you want to query a complete dataset with a single construct query.
PREFIX ex: <http://example.org/>
CONSTRUCT {
?s ?p ?o .
?g a ex:Graph ;
ex:hasData ?datalit .
} WHERE {
{
?s ?p ?o .
} UNION {
ComparableGraph
-> Menge von AtomicGraph
ConjunctiveGraph
-> Menge von ComparableGraph
-> Menge von AtomicGraph
=> Blank Node Scope beschränkt auf einen Graph
ConjunctiveGraph
-> Menge von AtomicDatasets
#!/usr/bin/env python3
import timeit
REP = 100
def perf_set():
for i in range(REP):
'a' in {'a', 'b', 'c', 'd', 'e'}
'c' in {'a', 'b', 'c', 'd', 'e'}
for i in $( git log --oneline <path_to_file_in_repo> | awk '{print $1}' ); do git show --raw $i | grep <path_to_file_in_repo> | awk '{print $4}' | xargs git show --raw | diff -w <path_to_my_file> - | grep "^>" | wc -l ; echo $i ; done
@white-gecko
white-gecko / docker-compose
Created March 8, 2024 20:45
A replacement for docker-compose to use podman-compose
#!/bin/sh
if [ $# -eq 1 ] && [ "$1" = "kill" ]; then
podman-compose kill --all
exit 0
fi
if [ "$1" = "rm" ]; then
podman-compose kill --all
if [ "$2" = "-v" ] ; then
podman volume rm --all
fi