Skip to content

Instantly share code, notes, and snippets.

Avatar

Jan Martinek jan-martinek

View GitHub Profile
View quotes.scss
/* correct quotes in various languages */
@mixin quotes($langs, $open, $close) {
@each $lang in $langs {
[lang="#{$lang}"] {
q::before { content: $open; }
q::after { content: $close; }
}
}
View config.yml
backend:
name: git-gateway
branch: master
media_folder: static/media
public_folder: /media
display_url: "https://pasporty.netlify.com"
slug:
encoding: ascii
clean_accents: true
collections:
View sdrm.sh
#!/bin/bash
# $ npm run build
# $ sh /path/to/this/script/sdrm.sh ./book "John Doe"
DIR=$1
NAME=$2
LICENSE="Licencováno k užívání dle poskytnuté licence čtenáři <i>$NAME</i>."
PLACEHOLDER='<section id="social-drm-placeholder"></section>'
REPLACEMENT='<section id="social-drm">'$LICENSE'</section>'
@jan-martinek
jan-martinek / volume.py
Created Aug 31, 2018
Volume service for VLC radio based on Arduino measuring potentiometer voltage
View volume.py
#!/usr/bin/python
import atexit
import re
import socket
import subprocess
import time
import os
import sys
from datetime import datetime
@jan-martinek
jan-martinek / turtle.py
Created Nov 3, 2017
Simple turtle graphics script for use with STS-Pi and explorerhat (no pen logic)
View turtle.py
#!/usr/bin/env python
# Explorer HAT/pHAT https://shop.pimoroni.com/search?type=product&q=explorer+hat
# STS-Pi https://shop.pimoroni.com/products/sts-pi
import time
import explorerhat
speed = 100
@jan-martinek
jan-martinek / retina-preview.php
Last active Aug 9, 2017
Preview last screenshot on another device
View retina-preview.php
<?php
/* I use this to quickly preview last taken screenshot on my retina ipad.
* (I use xip.io to quickly access virtual hosts on my dev machine.)
*
* Be sure to allow write in the dir where this script is located.
*
* It's possible to change the directory where screenshots are stored on mac.
* Consider using one exclusively for this purpose
* (see google.com/search?q=change+screenshot+location+mac).
@jan-martinek
jan-martinek / phat-clock.py
Last active Nov 21, 2018
Simple clock for raspberry pi + Unicorn pHAT
View phat-clock.py
#!/usr/bin/env python
# H | M*10 | M
# 1 5 9 | 1 5 | 1 5 9
# 2 6 10 | 2 | 2 6
# 3 7 11 | 3 | 3 7
# 4 8 12 | 4 | 4 8
import time
import unicornhat as unicorn