templ is a great view framework but there is no clear documentation (as of writing) showing how to use it with the Echo web framework. This short guide should show you how to set it up:
Install templ and echo:
go get github.com/a-h/templ| # For more options and information see | |
| # http://www.raspberrypi.org/documentation/configuration/config-txt.md | |
| # Some settings may impact device functionality. See link above for details | |
| # uncomment if you get no picture on HDMI for a default "safe" mode | |
| #hdmi_safe=1 | |
| # uncomment this if your display has a black border of unused pixels visible | |
| # and your display can output without overscan | |
| #disable_overscan=1 |
Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.
setInterval(() => {
for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
d.click()
}| {"quotes":[{"text":"We have two ears and one mouth, so we should listen more than we say.","author":"Zeno of Citium, as quoted by Diogenes Laërtius"},{"text":"Man conquers the world by conquering himself.","author":"Zeno of Citium"},{"text":"The goal of life is living in agreement with Nature.","author":"Zeno"},{"text":"if being is many, it must be both like and unlike, and this is impossible, for neither can the like be unlike, nor the unlike like","author":"Zeno"},{"text":"Well-being is attained little by little, and nevertheless is no little thing itself.","author":"Zeno of Citium"},{"text":"The reason why we have two ears and only one mouth is that we may listen the more and talk the less.","author":"Zeno"},{"text":"When a dog is tied to a cart, if it wants to follow, it is pulled and follows, making its spontaneous act coincide with necessity. But if the dog does not follow, it will be compelled in any case. So it is with men too: even if they don't want to, they will be compelled to follow what is desti |
| def json_error(status_code: int, exception: Exception) -> web.Response: | |
| """ | |
| Returns a Response from an exception. | |
| Used for error middleware. | |
| :param status_code: | |
| :param exception: | |
| :return: | |
| """ | |
| return web.Response( | |
| status=status_code, |
docker run -i -t --name nodejs ubuntu:latest /bin/bashSo here, -i stands for interactive mode and -t will allocate a pseudo terminal for us.
Some more trivia about these flags.
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: scriptname | |
| # Required-Start: | |
| # Required-Stop: | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: S 0 1 6 | |
| # Short-Description: Script short description | |
| # Description: Starts/Stops the script |
Resources for learning web design & front-end development:
ONLINE
Design