Skip to content

Instantly share code, notes, and snippets.

View jindrichmynarz's full-sized avatar

Jindřich Mynarz jindrichmynarz

View GitHub Profile
@jindrichmynarz
jindrichmynarz / dub_techno_in_sonic_pi.rb
Created December 8, 2015 19:11
Dub techno in Sonic Pi
use_debug false
use_bpm 130
# Our mixer!
master = (ramp *range(0, 1, 0.01))
kick_volume = 1
bass_volume = 1
revbass_volume = 1
snare_volume = 0.5
hats_volume = 0.5
@jindrichmynarz
jindrichmynarz / blank_nodes_to_hash_iris.sparql
Created October 5, 2016 16:36
Blank nodes to hash-based IRIs
DELETE {
?bnode ?outP ?outO .
?inS ?inP ?bnode .
}
INSERT {
?iri ?outP ?outO .
?inS ?inP ?iri .
}
WHERE {
{
@jindrichmynarz
jindrichmynarz / noise_meditation_in_sonic_pi.rq
Created November 21, 2021 11:33
Live coding noise in Sonic Pi
use_debug false
instruments = 1
drums = 1
live_loop :clock do
sleep 1
end
noise_cutoffs = range(100, 120, 0.1).reflect
@jindrichmynarz
jindrichmynarz / split_urls.ru
Created August 22, 2017 17:32
Split strings in pure SPARQL
# Solution from: <http://answers.semanticweb.com/questions/19162/split-and-trim-strings-in-sparql/27544>
PREFIX schema: <http://schema.org/>
DELETE {
?s schema:url ?urls .
}
INSERT {
?s schema:url ?url .
}
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import requests
from requests.auth import HTTPDigestAuth
def crud(graphStoreEndpoint, verb, graph, payload, auth):
function = {
"POST" : requests.post,
"PUT" : requests.put,
@jindrichmynarz
jindrichmynarz / tech4good_dub.rb
Created December 14, 2021 20:59
Live-coding in Sonic Pi at Tech4Good online meet-up
### Sonic Pi
### The Live Coding Music Synth for Everyone
### https://sonic-pi.net
use_debug false
use_bpm 80
drum_mix = 1
bass_mix = 1
synth_mix = 1
@jindrichmynarz
jindrichmynarz / typing_the_glam.rb
Created March 2, 2021 10:16
Typing the glam: a tribute to Apollo 440's Glam in Sonic Pi
# A tribute to
#
# Apollo 440: Glam
#
# Dedicated to my Dad
#
# (with whom I bought this on a CD back in the 1990s)
use_debug false
use_bpm 130
@jindrichmynarz
jindrichmynarz / dump_one_graph_nt.sql
Created February 25, 2016 10:41
OpenLink Virtuoso procedure for dumping a graph to N-Triples
CREATE PROCEDURE dump_one_graph_nt
( IN srcgraph VARCHAR
, IN out_file VARCHAR
, IN file_length_limit INTEGER := 1000000000
)
{
DECLARE file_name VARCHAR
; DECLARE env
, ses ANY
; DECLARE ses_len
@jindrichmynarz
jindrichmynarz / cbd.rq
Created February 24, 2018 18:20
Recursive concise bounded description
# SPARQL 1.1 implementation of concise bounded description (<https://www.w3.org/Submission/CBD>).
PREFIX : <http://example.com/>
PREFIX non: <http://non/>
CONSTRUCT {
:resource ?p1 ?r1 .
?r2 ?p2 ?r3 .
}
WHERE {
@jindrichmynarz
jindrichmynarz / indirect_wikidata.rq
Created April 22, 2020 06:25
Construct indirect Wikidata links used by DBpedia
# Run at the German DBpedia SPARQL endpoint: http://de.dbpedia.org/sparql
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT ?dbpedia
WHERE {
BIND (<http://www.wikidata.org/entity/Q1418856> AS ?wikidata)
BIND (strafter(str(?wikidata), "http://www.wikidata.org/entity/") AS ?qid)
BIND (iri(concat("http://wikidata.dbpedia.org/resource/", ?qid)) AS ?indirect_wikidata)
?dbpedia owl:sameAs ?indirect_wikidata .