This file contains 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
@app.after_request | |
def after_request(response: flask.Response): | |
from flask_sqlalchemy import get_debug_queries | |
app.config['SQLALCHEMY_RECORD_QUERIES'] = app.config['DEBUG'] | |
app.logger.debug("%s", response.__dict__) | |
count = 0 | |
for query in get_debug_queries(): | |
if query.duration >= 0: | |
count +=1 |
This file contains 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
# Install esptool | |
pip install esptool | |
# Flash the ESP32 module, it will erase everything on it. | |
python -m esptool --port COM5 erase_flash | |
# Install the micropython firmware | |
python -m esptool --port COM5 write_flash -z 0x1000 C:\Users\tabac\Downloads\esp32-20210623-v1.16.bin |
This file contains 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
importScripts('https://www.gstatic.com/firebasejs/8.3.2/firebase-app.js'); | |
importScripts('https://www.gstatic.com/firebasejs/8.3.2/firebase-messaging.js'); | |
var firebaseConfig = { | |
apiKey: "whatever", | |
authDomain: "notifications-test-stefano.1.com", | |
projectId: "notifications-test-1", | |
storageBucket: "notifications-test-1.appspot.com", | |
messagingSenderId: "maybe", | |
appId: "whoknows", |
This file contains 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
# Rename this distribution example file to motion.conf | |
# | |
# This config file was generated by motion 4.0 | |
############################################################ | |
# Daemon | |
############################################################ | |
# Start in daemon (background) mode and release terminal (default: off) |
This file contains 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
# See https://pre-commit.com for more information | |
# See https://pre-commit.com/hooks.html for more hooks | |
repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v3.1.0 | |
hooks: | |
- id: trailing-whitespace | |
- id: end-of-file-fixer | |
- id: check-yaml | |
- id: check-added-large-files |
This file contains 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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
#IfWinActive ahk_class Chrome_WidgetWin_1 ; Visual studio code | |
PgUp:: | |
Send, {Left down} ; If PageUp is sent, replace it with a Left button press | |
return |
This file contains 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
# CD to the README.md diretory | |
docker run -v `pwd`:`pwd` -w `pwd` pandoc/alpine --from=markdown --to=rst --output=README.rst README.md |
This file contains 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
{ | |
"scheduled.stakes.buy": | |
{ | |
"VGT": { "dailyReturnPercentage": -5.0, "cashAmount": 15000 }, | |
"MSFT": { "dailyReturnPercentage": -5.0, "cashAmount": 2000 }, | |
"ASAN": { "dailyReturnPercentage": -20.0, "cashAmount": 2000 }, | |
"TSLA": { "dailyReturnPercentage": -20.0, "cashAmount": 2000 }, | |
} | |
} |
This file contains 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
.jdump : Json Dumps | |
ANY → import json;json.dumps($expr$)$END$ | |
.pypara: Pytest Mark Parametrize | |
ANY → @pytest.mark.parametrize("one, two", [(),()])$END$ | |
.log : Logging Init | |
ANY → import logging\n LOGGER = logging.getLogger(__name__)$END$ | |
.quote : Quotes Around String |
This file contains 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
{ | |
"LED_LIGHT": true, | |
"MQTT": true, | |
"SLEEP_FOR": 2.1, | |
"EVENT_NAME": "motion_detected" | |
} |