Skip to content

Instantly share code, notes, and snippets.

View nicktimko's full-sized avatar

Nick Timkovich nicktimko

View GitHub Profile
@nicktimko
nicktimko / pipenv2tools.py
Last active January 22, 2020 21:28
Pipenv to pip-tools converter
#!/usr/bin/env python3
"""
Covert a Pipfile/[.lock] to a pip-tools requirements.(in|txt) file. While it's
only slightly annoying to convert the Pipfile to a requirements.in (which we
do) the primary goal is to convert the *locked* file with all the versions and
hashes, without *updating* any of them. This will allow bisection of problems
to the conversion from Pipenv to Pip-tools without confounding from myriad
updates to all the libraries used within.
To validate/clean up the new file, you can run the build command which will
@nicktimko
nicktimko / excludes-on-the-fly.ipynb
Created October 25, 2019 21:05
Benchmark: excludes once vs. each time
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nicktimko
nicktimko / titles.ipynb
Created April 25, 2019 18:44
extracting XML titles
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nicktimko
nicktimko / exceptget.ipynb
Created March 14, 2019 23:50
except vs get
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nicktimko
nicktimko / watchtest.py
Created December 23, 2018 01:51
Playing with the RPi WDT
#!/usr/bin/env python3
"""
Why bother with a service that hits the watchdog? The watchdog package seems
kinda daft if you're worried about your service locking up and/or not doing
something it should be doing.
Maybe could use something like this in conjuction with the watchdog daemon,
but don't want both to reset the WDT or that would be near pointless. Ideally
on my service start I'd like to permanently put the WDT into a state where
it's active, which seems to be done by opening the `/dev` file. Python
@nicktimko
nicktimko / awsome_operator.py
Last active May 14, 2018 14:20
python arbitrary binary operators
import functools
class Operator:
def __init__(self, func):
self.func = func
def __rlshift__(self, other):
return self.__class__(functools.partial(self.func, other))
def __rshift__(self, other):
@nicktimko
nicktimko / Passwords.ipynb
Created February 25, 2018 00:28
Manual Password Cracking from the 500M list
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.