Skip to content

Instantly share code, notes, and snippets.

View Cimbali's full-sized avatar

Cimbali Cimbali

  • 12:08 (UTC +01:00)
View GitHub Profile
#!/usr/bin/env python3
""" Priming sugar calculator
Computed from Robert McGill’s post Priming with sugar on byo.com
https://byo.com/article/priming-with-sugar/
Model for CO2 dissolved in beer by A. J. deLange,
fitted on data from ASBC’s Method of Analysis (MOA): Beer 13. Dissolved Carbon Dioxide
https://web.archive.org/web/20140327053255/http://hbd.org/ajdelange/Brewing_articles/CO2%20Volumes.pdf
@Cimbali
Cimbali / pinentry-keyring
Created April 9, 2020 15:51
A python pinentry wrapper to query your keyring for GPG passphrases, inspired from kwalletcli.
#!/usr/bin/python3
#
# Copyright © 2020 Cimbali <me@cimba.li>
# Iniital concept from mirabilos <m@mirbsd.org> at https://www.mirbsd.org/kwalletcli.htm
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the following conditions:
#
@Cimbali
Cimbali / justified_reader.css
Created January 14, 2017 18:46
Justified text in Firefox's "reader" mode
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url-prefix("about:reader") {
#moz-reader-content {
text-align: justify;
}
}
@Cimbali
Cimbali / pebsfixup.py
Last active May 17, 2017 00:18
Fix assembler source for PEBS usage (in python, cf. http://stackoverflow.com/a/35694557/1387346)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Fix assembler source for PEBS usage
By default, prints fixed file to stdout.
command line options:
"-o" -- output file (instead of stdout)
"-p" -- output patch instead of fixed file
"-i" -- in-place, overwrite input file(s)
@Cimbali
Cimbali / vlcvideowidget.py
Last active June 23, 2016 16:39
MCVE can't hide VLC player after it stopped, when running Python with Gtk+3 and VLC bindings in windows
#!/usr/bin/env python
from __future__ import print_function
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk, GObject, GLib
import ctypes
import sys, os