Skip to content

Instantly share code, notes, and snippets.

View orther's full-sized avatar
🏠
Working from home

Brandon Orther orther

🏠
Working from home
View GitHub Profile
@kj800x
kj800x / Hacking the LG Monitor's EDID.md
Last active May 3, 2024 20:14
Hacking the LG Monitor's EDID

preface: Posting these online since it sounds like these notes are somewhat interesting based on a few folks I've shared with. These are semi-rough notes that I basically wrote for myself in case I ever needed to revisit this fix, so keep that in mind.

I recently bought an LG ULTRAGEAR monitor secondhand off of a coworker. I really love it and it's been great so far, but I ran into some minor issues with it in Linux. It works great on both Mac and Windows, but on Linux it displays just a black panel until I use the second monitor to go in and reduce the refresh rate down to 60 Hz.

This has worked decent so far but there's some issues:

  • It doesn't work while linux is booting up. The motherboards boot sequence is visible just fine, but as soon as control is handed over to Linux and I'd normally see a splash screen while I'm waiting for my login window, I see nothing.
  • It doesn't work on the login screen. This would be fine if login consistently worked on my second screen, but I need to manually switch
@rootiest
rootiest / PREP_PRINT.cfg
Last active April 22, 2024 18:52
SuperSlicer Super Start for Klipper
[gcode_macro PREP_PRINT]
description: Loads and starts the print
variable_x_max: 0
variable_y_max: 0
variable_z_max: 0
variable_nozzle: 0
variable_fila_dia: 0
variable_bed_temp: 0
variable_extruder_temp: 0
variable_chamber_temp: 0
@souporserious
souporserious / build.mjs
Created February 24, 2022 02:48
Build script using esbuild and ts-morph to bundle library code.
import glob from 'fast-glob'
import { build } from 'esbuild'
import { Project } from 'ts-morph'
const project = new Project({
compilerOptions: {
outDir: 'dist',
emitDeclarationOnly: true,
},
tsConfigFilePath: './tsconfig.json',
const text = css({
color: '$gray12',
variants: {
size: {
// corrective letter-spacing and text-indent styles
// should go here too, because they're determined by font-size.
// You could also put line-height here too, if your devs prefer
// a default line-height that works in some cases. But understand
// that line-height is also a function of line-length, so the
@digitalknk
digitalknk / framework.nix
Created November 10, 2021 07:35
NixOS Configuration for the Framework Laptop
#
# NixOS Configuration for Framework Laptop
#
{ config, lib, pkgs, modulesPath, ... }:
{
boot.kernelParams = [ "mem_sleep_default=deep" ];
@jckw
jckw / Stack.tsx
Created October 25, 2021 20:39
Stitches Stack component for Figma-style positioning.
import { styled } from "@stitches/react"
const Stack = styled("div", {
display: "flex",
variants: {
dir: {
col: { flexDirection: "column" },
row: { flexDirection: "row" },
},
@temoncher
temoncher / strongly-typed-fsm.ts
Last active March 5, 2022 07:23
Builder pattern for strongly typed Finite State Machines in TypeScript
type State = string;
type Message = string;
type StatesList = readonly State[];
type MessagesConfig = Record<State, Record<Message, State>>;
type OneOf<S extends StatesList> = S[number];
type Send<
SBConfig extends StateBuilderConfig<StatesList, State, State>,
@sseagull
sseagull / Storybook with Stitches.md
Last active May 17, 2023 11:40
Stitches + Storybook `css` prop type definition clash fix

Using Stitches with Storybook

The setup for storybook is the same as their docs. Once you're repo is set up (Im using Typescript) and you have Stitches imported and set up (as per the stitches docs), the next step is to install Storybook.

I went with their npx setup: npx sb init (note: since my project was already set up with React/TS this command detected everything it needed to know, so there was no interactive prompt for me)

When using a styled stitches component everything will work as expected:

export const Button = styled('button', {
@santicalcagno
santicalcagno / configuration.nix
Created August 2, 2021 00:01
NixOS configuration
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
@luiznasciment0
luiznasciment0 / useKeyPress.ts
Last active July 15, 2021 08:16
hook to detect keyboard key pressed and execute an action when this key is pressed
import { useEffect } from 'react'
type KeyPress = {
key: string
action: () => void
}
const useKeyPress = ({ key, action }: KeyPress) => {
const onKeyDown = (e: KeyboardEvent) => {
if (e.key === key) action()