Skip to content

Instantly share code, notes, and snippets.

@zerok
zerok / autolock.py
Created Jan 15, 2018
YubiKey locking if unplugged
View autolock.py
#!/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 May 29, 2018
OmniGraffle: Export layers on top of base-layer as PNG
View README.md

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
Converter for WTD data from JSON to YAML
View convert_data_to_yaml.py
"""
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 Apr 9, 2017
Draft: PyGRAZ has two new organizers
View pygraz-has-two-new-organizers.md
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

View data.json
{
"type": "div",
"props": {
"className": "breadcrumbs breadcrumbs--wide"
},
"children": [
{
"type": "div",
"props": {
"className": "row expanded"
@zerok
zerok / strange.js
Created Dec 1, 2016
map on undefined
View strange.js
[1, undefined, 2].map(v => v+1)
# [ 2, NaN, 3 ]
(new Array(5)).map(v => v+1)
# [ , , , , ]
@zerok
zerok / mtime_test.py
Created Nov 27, 2016
A little script for checking when the mtime of a folder changes
View mtime_test.py
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 Sep 21, 2016
Draft: My first WritingDay
View index.md
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 Jul 31, 2016
Extractor for DjangoCon Europe 2016 data into PyTube
View djangoconeu-extractor.py
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 Jun 13, 2016
DRAFT: Hello PyTube!
View post.md

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.