Skip to content

Instantly share code, notes, and snippets.

View voigt's full-sized avatar

Christoph Voigt voigt

View GitHub Profile
@voigt
voigt / runtime_output
Created April 19, 2022 16:42
Wordcount
$ wordcounter ./zig-out/bin/wordcounter
Start processing
> No man is an island,
No ('No' added to HashMap)
man ('man' added to HashMap)
is ('is' added to HashMap)
an ('an' added to HashMap)
island, ('island,' added to HashMap)
> Entire of itself,
Entire ('Entire' added to HashMap)
@voigt
voigt / stdout
Last active April 19, 2022 18:41
wordcounter
./zig-out/bin/wordcounter text.txt
Found 62 Keys
A - 1
sea, - 1
whom - 1
clod - 1
main. - 1
part - 1
of - 5
Europe - 1
@voigt
voigt / json
Created October 11, 2018 14:26
product_import.json
{
"head": {
"shop": "storefront-catalog-en",
"locale": "en-US",
"internal_disable_image_processing": true
},
"items": [
{
"product_id": "1000101",
"variant_group_id": "variant_group_10001",
@voigt
voigt / json
Created October 11, 2018 11:41
{
"head": {
"shop": "storefront-catalog-en",
"locale": "en-US",
"internal_disable_image_processing": true
},
"items": [
{
"product_id": "1000101",
"variant_group_id": "variant_group_10001",
@voigt
voigt / keybase.md
Created February 9, 2017 08:57
keybase proof

Keybase proof

I hereby claim:

  • I am voigt on github.
  • I am voigt (https://keybase.io/voigt) on keybase.
  • I have a public key ASA6Iu19J3rC3X4XRew6B6eCCX7ztyK_1zq3cvSv1z8Mmwo

To claim this, I am signing this object:

# Returns all Churches from Lower Saxony, Germany
# including label, article URL, long, lat
# JSON: https://query.wikidata.org/bigdata/namespace/wdq/sparql?query=SELECT%20DISTINCT%20%3Fitem%20%3FitemLabel%20%3Flat%20%3Flong%0AWHERE%20%7B%0A%20%20%20%20%3Fitem%20wdt%3AP31%20wd%3AQ16970%20.%0A%20%20%20%20%3Fitem%20wdt%3AP17%20wd%3AQ183%20.%0A%20%20%20%20%3Fitem%20wdt%3AP131*%20wd%3AQ1197%20.%0A%20%20%0A%20%20%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22de%22%20%7D%0A%7D&format=json
SELECT DISTINCT ?item ?itemLabel ?article ?lat ?long
WHERE {
?item wdt:P31 wd:Q16970 .
?item wdt:P17 wd:Q183 .
?item wdt:P131* wd:Q1197 .
OPTIONAL {
SELECT DISTINCT ?item ?itemLabel ?article ?lat ?long
WHERE {
?item wdt:P31 wd:Q16970 .
?item wdt:P17 wd:Q183 .
?item wdt:P131* wd:Q1197 .
OPTIONAL {
?item p:P625 ?statement . # coordinate-location statement
?statement psv:P625 ?coordinate_node .
?coordinate_node wikibase:geoLatitude ?lat .
@voigt
voigt / gist:4a076cc815f03fbfeda6a3aa0e0b2a50
Created December 3, 2016 22:40 — forked from ept/gist:4475995
Syntax highlighting code for PowerPoint (Mac OS)

How to add syntax-highlighted code to PowerPoint slides (Mac OS)

  1. pygmentize -f rtf FILE | pbcopy
  2. Paste into TextEdit (in rich text mode: Format → Make Rich Text before pasting), and copy to clipboard again.
  3. In PowerPoint, Edit → Paste Special… → Styled Text.

(Pasting RTF directly into PowerPoint doesn't work correctly, at least with PowerPoint 2008 — it extends colour spans longer than it should, and sometimes removes line breaks. Going via TextEdit seems to solve the problem.)

env:
global:
- secure: "..." # replace this with the travis encryption output!
- GIT_DEPLOY_DIR=public # default output dir of Hugo (change it, when you use configured it!)
- GIT_DEPLOY_BRANCH=master # target branch, replace by "gh-pages" for Github Project Pages
- GIT_DEPLOY_USERNAME="Travis CI" # dummy name
- GIT_DEPLOY_EMAIL=user@example.com # replace by your email
branches:
only:
@voigt
voigt / gist:c8a95ecbef22445187c3
Created September 29, 2015 08:53 — forked from phagedorn/gist:b1f310cdebb7e89c3e54
MySQLL Table size as MB/GB...
SELECT TABLE_NAME AS "Table",
TABLE_ROWS AS "Rows",
CONCAT((FORMAT((DATA_LENGTH) / POWER(1024,2),2)), ' Mb') AS "Data Size",
CONCAT((FORMAT((INDEX_LENGTH) / POWER(1024,2),2)), ' Mb') AS "Index Size",
CONCAT((FORMAT((DATA_LENGTH+ INDEX_LENGTH) / POWER(1024,2),2)), ' Mb') AS "Total Size",
TRIM(TRAILING ', ' FROM CONCAT_WS(', ', ENGINE, TABLE_COLLATION, CREATE_OPTIONS)) AS "Type"
FROM information_schema.TABLES
WHERE information_schema.TABLES.table_schema = "schema_name"