Skip to content

Instantly share code, notes, and snippets.

from itertools import cycle
#### I wrote this to use with flask to have a state-aware backend storage
#### Turns out flask already has this: http://flask.pocoo.org/docs/0.12/appcontext/
class o(dict):
hi=''
def __init__(self, env):
self.env = env
##
## selfie.py
## Quick illustration of the 'self' keyword
## Illustration of `if __name__ == '__main__'`
##
##
## Read through the below code and comments, then try the following commands
## python3 selfie.py # see everything that is printed to screen
## python3 # see that the code outside the class and the __name__ if condition is run
@dev-dull
dev-dull / layout.kbd.json
Last active March 31, 2020 03:05
Untitled Keyboard Layout
[
[
{
"r": 5,
"y": -1.5,
"x": 19.25
},
"PrtSc",
"Scroll Lock",
"Pause\nBreak"
@dev-dull
dev-dull / yams_test.py
Last active May 22, 2020 20:16
Simple script to test format validity of yaml files.
import sys
import yaml
# sample usage:
# user@shell$ python3 yams_test.py file1.yaml file2.yaml file3.yaml
print(sys.argv)
for fname in sys.argv[1:]:
fin = open(fname, 'r')