Skip to content

Instantly share code, notes, and snippets.

Avatar
💩
creating tech debt

Brady Law babldev

💩
creating tech debt
View GitHub Profile
@babldev
babldev / decode_flask_cookie.py
Last active May 21, 2020
Decode a Flask Session cookie, given the cookie and secret key
View decode_flask_cookie.py
@babldev
babldev / github.sh
Created Apr 5, 2019
Open commit on github v2
View github.sh
#!/bin/sh
REPO=$(git config --get remote.origin.url | sed "s/^.*://" | sed "s/\.git\$//")
open https://github.com/$REPO/commit/$1
@babldev
babldev / auto_refreshing_cache.py
Last active May 13, 2016
A non-blocking, auto-updating cache.
View auto_refreshing_cache.py
"""
A non-blocking, auto-updating cache.
Consider the following requirements:
- You need a cache that takes a long time to build.
- The creation of the cache is CPU bound.
- The cache needs to be rebuilt at some regular interval.
- The cache is receiving constant queries, and you do not want any blocking while it is rebuilding.
This example provides a solution to such requirements, including:
You can’t perform that action at this time.