Skip to content

Instantly share code, notes, and snippets.

@heiso
heiso / generate-remix-routes.ts
Last active October 13, 2023 22:57
Generate remix routes
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) {
@heiso
heiso / printer.cfg
Last active April 7, 2024 21:29
Klipper printer config - Artillery Genius (MKS gen L)
[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

Git cheat sheet

TLDR

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

@heiso
heiso / readme.md
Last active February 14, 2023 18:49
From Tech with Love

From Tech with Love

Some Coding Principles

Technical test

Goal

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).

Data

Countries API

Documentation