Skip to content

Instantly share code, notes, and snippets.

View LongLiveCHIEF's full-sized avatar

Brian Vanderbusch LongLiveCHIEF

View GitHub Profile
@LongLiveCHIEF
LongLiveCHIEF / udevadm_info.log
Last active August 27, 2023 17:00
udev info for 5" elecrow pitft - HDMI and using GPIO for power and spi
pi@ratos:/dev/dri $ ls -al │
total 0 │
drwxr-xr-x 3 root root 120 Aug 27 14:34 . │
drwxr-xr-x 16 root root 3960 Aug 27 14:34 .. │
drwxr-xr-x 2 root root 100 Aug 27 14:34 by-path │
crw-rw---- 1 root video 226, 0 Aug 27 14:34 card0
@LongLiveCHIEF
LongLiveCHIEF / description.md
Created September 27, 2022 12:23
Dyanamic MFE's with react
@LongLiveCHIEF
LongLiveCHIEF / git-amend
Last active May 18, 2022 13:28 — forked from esebastian/git-amend
Amend the commit message of one specific git commit and rebase to apply the changes
#!/bin/sh
# Amend the commit message one specific commit and rebase
# to apply the changes. Given the SHA hash or a reference
# of the commit to amend, it checkouts the commit, amends
# it interactively and rebases the repo history in current branch.
#
currentbranch=$(git branch --show-current)
@LongLiveCHIEF
LongLiveCHIEF / createCtx-noNullCheck.tsx
Created January 31, 2022 16:35 — forked from swyxio/createCtx-noNullCheck.tsx
better createContext APIs with setters, and no default values, in Typescript. this is documented in https://github.com/typescript-cheatsheets/react-typescript-cheatsheet/blob/master/README.md#context
// create context with no upfront defaultValue
// without having to do undefined check all the time
function createCtx<A>() {
const ctx = React.createContext<A | undefined>(undefined)
function useCtx() {
const c = React.useContext(ctx)
if (!c) throw new Error("useCtx must be inside a Provider with a value")
return c
}
return [useCtx, ctx.Provider] as const
@LongLiveCHIEF
LongLiveCHIEF / snippet.gcode
Last active February 20, 2021 17:37
CNC Probing Snippet
(MSG, Attach Probe)
M0
G38.2 Z-50 F60
G90
G10 L20 P1 Z0
G91
G0 Z15
G90
(MSG, Detach Probe)
M0
@LongLiveCHIEF
LongLiveCHIEF / Client.js
Created June 21, 2020 16:40
Storybook with simple diy decorator using ApolloProvider
import {
ApolloClient,
HttpLink,
InMemoryCache,
} from '@apollo/client'
export const Client = new ApolloClient({
cache: new InMemoryCache(),
link: new HttpLink({
uri: 'http://localhost:4000/graphql'
@LongLiveCHIEF
LongLiveCHIEF / README.md
Last active April 13, 2023 12:25
Run node, npm, npx, yarn as container

Developing with Node, without installing node!

Note: currently only works on *nix systems (until a powershell script can be created)

With the technique below, you can run node, npm, npx, or yarn commands as if the programs were installed natively on your system, and you won't even know the difference! This includes any ports that your app or dev process will start up and use for development, as well as compatibility with persistent npm config --global cli usage.

See more in the Usage section below.

@LongLiveCHIEF
LongLiveCHIEF / hemera_extruder_tips_and_gotchas.md
Last active April 9, 2023 21:21
Hemera Extruder Assembly Tips and Gotchas

I got the E3D Hemera (formerly called the Hermes) a week ago, and at first glance was impressed by the amount of documentation/guides E3D worked with popular YouTubers to create.

However, as time went on with my install, I discovered each guide was missing critical information, had bits of information incorrect, or included firmware files in a old or flattened format, making it difficult to discern firmware changes required.

I'm very familiar with Marlin 2.x, and so I finally decided to just go straight to the Hemera Datasheet, and finally got things working.

I'm not going to do a full guide, since I'm hoping one of the popular YouTubers who is capable of a high production quality video will do a comprehensive guide, but I have put together the following tips and lessons learned that should help some of you who are struggling but can't figure out why things aren't working.

*For reference: I have an Ender 3 with an SKR 1.3 using Marlin 2.x, equipped with TMC

@LongLiveCHIEF
LongLiveCHIEF / Configuration.h
Created July 2, 2019 00:27
Marlin 2.0 configs for my printer
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.