git config --global pull.rebase true to make your pull becomes pull --rebase
git fetch a lot
git rebase origin/develop sometimes
git push --force-with-lease after a rebase
git reset --hard origin/my_branch to get back the remote branch
git cherry-pick is a good friend when mixed with some rebase
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
| change volume -> `amixer -c 2 sset PCM 80%` | |
| play m3u8 -> `mpv --video-aspect-override=16:10 --video-zoom=0 --video-pan-x=0 --video-pan-y=0 --panscan=1.0 --osc=no --video-osd=no --audio-device=alsa/default:CARD=Headphones --video-rotate=270 https://artesimulcast.akamaized.net/hls/live/2031003/artelive_fr/index.m3u8` | |
| low brightness -> `echo 60 > /sys/class/backlight/10-0045/brightness` | |
| full brightness -> `echo 255 > /sys/class/backlight/10-0045/brightness` | |
| enable readonly fs -> `sudo raspi-config nonint enable_overlayfs` | |
| `sudo raspi-config nonint enable_bootro` | |
| disable readonly fs -> `sudo raspi-config nonint disable_overlayfs` | |
| `sudo raspi-config nonint disable_bootro` |
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 { readConfig } from '@remix-run/dev/dist/config.js' | |
| import type { ConfigRoute, RouteManifest } from '@remix-run/dev/dist/config/routes.js' | |
| import { writeFileSync } from 'fs' | |
| import { format, resolveConfig } from 'prettier' | |
| const outputPath = `routes.ts` | |
| function buildPath(routes: RouteManifest, route: ConfigRoute): string { | |
| const result = [] | |
| if (route.parentId) { |
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
| [include mainsail.cfg] | |
| [gcode_macro _CLIENT_VARIABLE] | |
| variable_use_custom_pos : False ; use custom park coordinates for x,y [True/False] | |
| variable_custom_park_x : 0.0 ; custom x position; value must be within your defined min and max of X | |
| variable_custom_park_y : 0.0 ; custom y position; value must be within your defined min and max of Y | |
| variable_custom_park_dz : 2.0 ; custom dz value; the value in mm to lift the nozzle when move to park position | |
| variable_retract : 1.0 ; the value to retract while PAUSE | |
| variable_cancel_retract : 5.0 ; the value to retract while CANCEL_PRINT | |
| variable_speed_retract : 35.0 ; retract speed in mm/s |
- Rule of three: https://en.wikipedia.org/wiki/Rule_of_three_(computer_programming)
- Clever Code Considered Harmful: https://www.joshwcomeau.com/career/clever-code-considered-harmful/
- The wrong abstraction: https://sandimetz.com/blog/2016/1/20/the-wrong-abstraction
- Stop trying to be so DRY, instead Write Everything Twice (WET): https://dev.to/wuz/stop-trying-to-be-so-dry-instead-write-everything-twice-wet-5g33
- Maintainability through colocation: https://kentcdodds.com/blog/colocation
Make a simple web app that will display the weather in a given list of capital city, through the use of the two following APIs: restcountries to list capital cities, and openweathermap to return the weather in a given city (retrieved from restcountries). You are free to design your own layout, but make sure to keep a simplistic theme, and a coherent correlation between a city and its weather. As a bonus, think about offline and caching functionalities (serviceWorker).