This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from contextlib import contextmanager | |
from inspect import currentframe, getouterframes | |
@contextmanager | |
def let(**bindings): | |
frame = getouterframes(currentframe(), 2)[-1][0] # 2 because first frame in `contextmanager` decorator | |
locals_ = frame.f_locals | |
original = {var: locals_.get(var) for var in bindings.keys()} | |
locals_.update(bindings) | |
yield |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kano_wand.kano_wand import Shop, Wand, PATTERN | |
from qhue import Bridge | |
import moosegesture as mg | |
import time | |
import random | |
import math | |
class GestureWand(Wand): | |
def post_connect(self): | |
self.gestures = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Type=Application | |
Name=Godot | |
GenericName=Game engine | |
Comment=2D and 3D game engine | |
Exec=/home/username/Public/Godot_v3.0.6-stable_x11.64 | |
Icon=/home/username/Public/godot.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export EDITOR=vim | |
fortune | cowsay -f duck | lolcat | |
alias grit=". /home/$USER/Documents/grit/grit" | |
alias please='sudo $(fc -ln -1)' | |
alias pyss="python3 /home/$USER/Documents/pyss/pyss.py" | |
alias serv='python3 -m http.server' | |
alias timer='echo "Ctrl+C to stop"; time cat' | |
alias update='sudo apt update && apt list --upgradable' | |
alias upgrade='sudo apt upgrade && sudo apt autoremove && flatpak update && flatpak remove --unused && update' | |
alias calc='bc' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyqrcode, sys, base64 | |
if len(sys.argv) < 2: | |
print("Usage: python3 wifi.py [network] [password]") | |
quit() | |
network = sys.argv[1] | |
if len(sys.argv) > 2: | |
protocol = "WPA/WPA2" | |
pwd = sys.argv[2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import lru_cache | |
@lru_cache(None) | |
def fib(n): | |
return n if n < 2 else fib(n-1) + fib(n-2) |
NewerOlder