Skip to content

Instantly share code, notes, and snippets.

@itsff
itsff / .gitconfig
Created April 3, 2019 03:20
My gitconfig file
[user]
name = Filip Frącz
email = [email protected]
username = filip
[core]
editor = emacsclient --tty --create-frame
#editor = vim
[filter "lfs"]
@itsff
itsff / filip-dox.json
Last active October 25, 2020 21:11
ErgoDox Layout
{"version":1,"notes":"","documentation":"\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n","keyboard":"hotdox","keymap":"filip-dox","layout":"LAYOUT_ergodox","layers":[["LCTL_T(KC_GRV)","KC_1","KC_2","KC_3","KC_4","KC_5","LSFT(KC_INS)","KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_INS","KC_RALT","KC_A","KC_S","KC_D","KC_F","KC_G","KC_LSFT","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_DEL","KC_RALT","TG(1)","MO(2)","MO(1)","KC_LCTL","RALT_T(KC_APP)","KC_LGUI","KC_HOME","KC_SPC","KC_BSPC","KC_END","KC_6","KC_7","KC_8","KC_9","KC_0","KC_MINS","KC_EQL","KC_LBRC","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_BSLS","KC_H","KC_J","KC_K","KC_L","LT(2,KC_SCLN)","LGUI_T(KC_QUOT)","KC_RBRC","K
from __future__ import print_function
import re
def create_leg(osi_symbol, ratio):
regex = re.compile("(?<symbol>\w+)\s*(?<year>\d{2})(?<month>\d{2})(?<day>\d{2})(?<call_put>[CP])(?<dollars>\d+)(?<cents>\d{2})")
m = regex.match(osi_symbol)
if not m:
raise ValueError("Huh? Is this right OSI symbol: " + osi_symbol)