Skip to content

Instantly share code, notes, and snippets.

@wirekang
wirekang / md.md
Created February 25, 2025 12:11
Orca Slicer's Adaptive Bed Mesh with Creality K1C

Orca Slicer supports Adaptive Bed Mesh: https://github.com/SoftFever/OrcaSlicer/wiki/adaptive-bed-mesh

I replaced the built-in CX_PRINT_LEVELING_CALIBRATION with the given example.

Printer settings -> Machine G-code -> Machine start G-code

M140 S0
M104 S0
 
START_PRINT EXTRUDER_TEMP=[nozzle_temperature_initial_layer] BED_TEMP=[bed_temperature_initial_layer_single] BED_MESH_MIN={adaptive_bed_mesh_min[0]},{adaptive_bed_mesh_min[1]} BED_MESH_MAX={adaptive_bed_mesh_max[0]},{adaptive_bed_mesh_max[1]} BED_MESH_ALGORITHM=[bed_mesh_algo] BED_MESH_PROBE_COUNT={bed_mesh_probe_count[0]},{bed_mesh_probe_count[1]}
@wirekang
wirekang / md5_bytea.sql
Created November 13, 2023 01:55
Postgres text to md5 bytea function
create or replace function "md5_bytea"(text) returns bytea as
$$
select decode(md5($1), 'hex');
$$
language sql
@wirekang
wirekang / base64_url.sql
Created November 13, 2023 01:46
Postgres web-safe base64 encode
create or replace function "base64_url"(bytea) returns text as
$$
select replace(replace(replace(encode($1, 'base64'),'/','_'),'+','-'),'=','');
$$
language sql
@wirekang
wirekang / jobrunr6.0.0.sql
Last active February 8, 2023 06:20
JobRunr 6.0.0 migration(postgres)
CREATE TABLE "jobrunr_migrations"
(
"id" NCHAR(36) PRIMARY KEY,
"script" VARCHAR(64) NOT NULL,
"installedon" VARCHAR(29) NOT NULL
);
CREATE TABLE "jobrunr_jobs"
(
"id" NCHAR(36) PRIMARY KEY,
@wirekang
wirekang / compact-naver.md
Last active October 31, 2022 05:50
Compact Naver

image

Elements to hide

www.naver.com##DIV[id="veta_branding"]
www.naver.com##DIV[class="footer_inner"]
www.naver.com##DIV[id="shopcast"]
www.naver.com##DIV[id="NM_FAVORITE"]
@wirekang
wirekang / example.ts
Created May 9, 2022 11:49
Typescript type
interface I1 {
p1: (a: boolean)=>void
p2: (a: string) => void
p3: (a: number) => void
}
const v1:I1 = 0 as any
function f1<T extends keyof I1>(
name: T,
package errutil
import (
"context"
"github.com/samber/lo"
)
func Delay[T any](target *error) func(v T, err error) T {
a := func(v T, err error) T {