Skip to content

Instantly share code, notes, and snippets.

View mdegis's full-sized avatar

Melih Degis mdegis

  • Istanbul, TUR
View GitHub Profile
"""Flask Extensions"""
import flask
import flask_debugtoolbar
class DevToolbar:
"""Add debug toolbars with json to html
Note you must pass `_debug` param to convert the json response
"""
def __init__(self, app):
/etc/udev/rules.d/hdmi_sound.rules :
```SUBSYSTEM=="drm", RUN+="/usr/local/bin/hdmi_sound_toggle", ACTION=="change"```
/usr/local/bin/hdmi_sound_toggle:
```
!/bin/sh
USER_NAME=`who | grep "(:0)" | cut -f 1 -d ' '| sort -u`
USER_ID=`id -u $USER_NAME`
HDMI_STATUS=`cat /sys/class/drm/card0/*HDMI*/status`
export PULSE_SERVER="unix:/run/user/"$USER_ID"/pulse/native"
#!/usr/bin/env python
"""
=====================================
PEP 20 (The Zen of Python) by example
=====================================
Usage: %prog
:Author: Hunter Blanks, hblanks@artifex.org / hblanks@monetate.com