Skip to content

Instantly share code, notes, and snippets.

View ri0t's full-sized avatar
💭
Building the future - check out @isomeric 👍

riot ri0t

💭
Building the future - check out @isomeric 👍
View GitHub Profile
@ri0t
ri0t / timerdemo.py
Created April 28, 2020 14:05
Working with timeouts
# Assumption is that at this point, imports and keypad initialization have been done
timeout = 15 # Seconds, until entry is reset
entry_begin = 0 # Timestamp when entry began
sequence = "" # Entrysequence with keys appended
pin = "1234"
idle_time = 0.05 # 50 ms, should work fine
while True:
now = time.time()
@ri0t
ri0t / split-folder.sh
Created December 8, 2018 16:52
Repo-Splitter
#!/bin/bash
# $1 = Big repo
# $2 = Subfolder to split
# $3 = New organization
# $4 = New reponame
if [ $# -ne 4 ]; then
echo "illegal number of parameters".
echo-
@ri0t
ri0t / gist:970e3822d39243a9ba8539af09f41a7e
Created July 16, 2018 15:56
Lightningtalks jinja template
.. list-table::
:widths: auto
{% for talk in talks %}
* - mainhall
- Lightning Talk
- {{ talk.author }}
- `Website <{{ talk.websiteurl }}>`_
- `{{ talk.title }} </pdf/lightningtalks/{{ talk.pdfname }}>`_
@ri0t
ri0t / lac18_ical_filter.py
Created May 25, 2018 13:06
LAC18 Summary extractor
def ical_import_filter(original, log):
summary = original.summary
stuff = summary.split('\n', maxsplit=5)
# if not(stuff[0].startswith('Author:') and stuff[1].startswith('Type:') and stuff[2].startswith('Topics:') and stuff[3].startswith('Keywords:') and stuff[4].startswith('Abstract')):
# log(str(summary.replace('\n', '@@@\n')), lvl=hilight)
data = {
'author': [],
'event_type': 'Unknown',
'event_id': 'Unknown',