Skip to content

Instantly share code, notes, and snippets.

@steelman
steelman / this.pdf
Created November 29, 2021 21:34
Basic example how to use CIDFonts to render non-Latin-1 characters in PDF
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@steelman
steelman / expograph.py
Created March 28, 2020 10:47
Time spent looking at exponential graphs (log scale)
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import matplotlib.dates as md
t0 = pd.Timestamp('2020-01-01')
x = pd.date_range('2020-01-01', '2020-03-31')
y = np.exp(13.815510558/90 * (x-t0).days)
xt = [pd.Timestamp('2020-01-15'),pd.Timestamp('2020-02-15'),pd.Timestamp('2020-03-15')]
@steelman
steelman / prices-vs-costs.dat
Last active November 24, 2019 19:20
Prices versus costs
; Good
~yearly from 2019-11-01
Assets:Checking
Expense:Food 10 apples {=1,00 PLN}
Expense:Food 10 pears {=1,00 PLN}
2019-11-19 Foo
Assets:Checking
Expense:Food 10,0 apples {{=10,0 PLN}}
Expense:Food 10,0 pears {{=10,0 PLN}}
@steelman
steelman / import.py
Created April 24, 2019 08:52
A wrapper for ImageMagick's import to add created files to Gtk's recent manager and find the quickly in Gimp
#!/usr/bin/python3
#
# This work is in public domain
#
import subprocess
import sys
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GLib, Gio
@steelman
steelman / gh60.json
Created August 1, 2018 12:50
keyboard layout
/* http://www.keyboard-layout-editor.com/#/ */
[
{
"backcolor": "#111111",
"switchMount": "cherry"
},
[
{
"c": "#222222",
"t": "#cccccc"
@steelman
steelman / polish-holidays.el
Created May 22, 2018 08:07
A list of Polish holidays for Emacs.
;; -*- coding: utf-8 -*-
;; Według ustawy o dniach wolnych od pracy z dnia 18 stycznia 1951, z
;; późniejszymi zmianami:
;;
(defcustom holiday-polish-holidays
'((holiday-fixed 1 1 "Nowy Rok")
(holiday-fixed 1 6 "Święto Trzech Króli")
(holiday-easter-etc 0 "Pierwszy dzień Wielkiej Nocy")
(holiday-easter-etc 1 "Drugi dzień Wielkiej Nocy")
(holiday-fixed 5 1 "Święto Państwowe")
// ==UserScript==
// @include http://audycje.tokfm.pl/*
// @description Wyciąga bezpośrednie linki do plików mp3
// @author Marek Drwota
// ==/UserScript==
function zm() {
var podcasts_data=document.getElementsByClassName('tok-topwrap__topwrap tok-topwrap__topwrap--podcast');
var linki = null;
var i = 0;
@steelman
steelman / eddsa.py
Last active December 29, 2016 19:07
# -*- mode: python; coding: utf-8 -*-
# Bugs in draft:
# + Indentation issues in Section 6.
import hashlib
class EdDSA:
def encode():
pass
def __init__(self, phflag=0, ctx=None):
@steelman
steelman / PIT.gnuplot
Last active November 16, 2017 16:27
Podatek PIT
set xlabel "PLN"
set ylabel "%"
set yrange [0:30]
set term pngcairo
set output "01pit2015.png"
plot [0:160000] x < 3089 ? 0 : \
x < 85228 ? 100*(0.18*(x-3089))/x : \
100*(14839+0.32*(x-85228))/x title "Stawka PIT w 2015 r."
@steelman
steelman / sample_tri_input.txt
Last active March 24, 2016 15:20
Simple trilateration
12
8
2
1 54.343 948.686
2 600.201 167.674
1 3 208.14
1 4 483.96
2 4 600.74
2 5 261.58
2 6 395.61