Skip to content

Instantly share code, notes, and snippets.

@yhancik
yhancik / keybase.md
Created April 6, 2017 15:42
Just keybase stuff

Keybase proof

I hereby claim:

  • I am yhancik on github.
  • I am yhancik (https://keybase.io/yhancik) on keybase.
  • I have a public key whose fingerprint is 057E 1E95 233E 48EC AC41 1689 9020 1BA8 6D78 6CA6

To claim this, I am signing this object:

<script>
// fullscreen stuff
var fullscreenButton = document.getElementById("fullscreen-button");
var fullscreenDiv    = document.getElementById("crtCanvas");
var fullscreenFunc   = fullscreenDiv.requestFullscreen;
if (!fullscreenFunc) {
  ['mozRequestFullScreen',
   'msRequestFullscreen',
   'webkitRequestFullScreen'].forEach(function (req) {
     fullscreenFunc = fullscreenFunc || fullscreenDiv[req];
@yhancik
yhancik / online.sh
Last active November 24, 2017 14:14
Script for a Raspberry Pi, checking if it's online (or more accurately if Google.com is up), says it aloud with PicoTTS
case "$(curl -s --max-time 2 -I http://google.com | sed 's/^[^ ]* *\([0-9]\).*/\1/; 1q')" in
[23]) pico2wave -w internet.wav "Online!";;
5) pico2wave -w internet.wav "Proxy issue.";;
*) pico2wave -w internet.wav "Offline or slow?";;
esac
aplay internet.wav
@yhancik
yhancik / font-face.py
Created June 1, 2019 14:33
Generate @font-faces from the font files of a given directory
# Generate @font-faces from font files in a given directory.
# Very basic; doesn't suppport multiple files per @font-face
from pathlib import Path
import sys
font_formats = {"ttf":"truetype", "otf":"opentype", "woff":"woff", "woff2":"woff2"}
dir = ""