Skip to content

Instantly share code, notes, and snippets.

View zerok's full-sized avatar

Horst Gutmann zerok

View GitHub Profile
@zerok
zerok / autolock.py
Created January 15, 2018 20:46
YubiKey locking if unplugged
#!/usr/bin/env python3
import time
import subprocess
from datetime import datetime
from datetime import timedelta
def lock():
subprocess.check_call("""osascript -e 'tell application "System Events" to start current screen saver'""", shell=True, stderr=subprocess.STDOUT)
@zerok
zerok / README.md
Last active November 19, 2021 19:58
OmniGraffle: Export layers on top of base-layer as PNG

Layer export for OmniGraffle

If you have a Graffle document (doc.graffle) with a canvas named "mycanvas" holding the following layers ...

  • Extra 3
  • Extra 2
  • Extra 1
  • Base

... then these images will be generated:

@zerok
zerok / convert_data_to_yaml.py
Created May 14, 2017 23:01
Converter for WTD data from JSON to YAML
"""
This script is used to convert the JSON data we have on each conference into
YAML.
"""
import collections
import glob
import io
import json
import yaml
@zerok
zerok / pygraz-has-two-new-organizers.md
Last active April 9, 2017 19:47
Draft: PyGRAZ has two new organizers
date draft title tags
2017-04-09 21:17:14 +0200
true
PyGRAZ has two new organizers
pygraz
community

Back in 2010 when we started [PyGRAZ][], all we wanted was to create a simple

{
"type": "div",
"props": {
"className": "breadcrumbs breadcrumbs--wide"
},
"children": [
{
"type": "div",
"props": {
"className": "row expanded"
@zerok
zerok / strange.js
Created December 1, 2016 13:40
map on undefined
[1, undefined, 2].map(v => v+1)
# [ 2, NaN, 3 ]
(new Array(5)).map(v => v+1)
# [ , , , , ]
@zerok
zerok / mtime_test.py
Created November 27, 2016 07:00
A little script for checking when the mtime of a folder changes
from pathlib import Path
from shutil import rmtree
from time import sleep
from contextlib import contextmanager
class Test:
def __init__(self, path):
self.path = path
self.times = self.get_times()
@zerok
zerok / index.md
Created September 21, 2016 07:37
Draft: My first WritingDay
date draft title tags
2016-09-19 12:05:04 +0200
true
My First Writing-day
travel
conference
writethedocs
prague
@zerok
zerok / djangoconeu-extractor.py
Created July 31, 2016 07:15
Extractor for DjangoCon Europe 2016 data into PyTube
import html5lib
import shutil
import pathlib
import json
import collections
import requests
import re
import sys
from icalendar.cal import Calendar
@zerok
zerok / post.md
Created June 13, 2016 16:50
DRAFT: Hello PyTube!

Hello PyTube!

For many years the Python community has had an awesome website called [pyvideo.org][] which tried to aggregate all conference videos on a single site to make it easier to find them. In January [Will Kahn-Greene][wkg], one of the awesome people behind it, announced, that work on the project was [about to end][]. Then in March he continued with a length [status update][] announcing the [pyvideo-data][] repository. That repository contains a data dump of all the collected videos and should act as a starting point for other people to work with.