Skip to content

Instantly share code, notes, and snippets.

View johndatserakis's full-sized avatar

John Datserakis johndatserakis

View GitHub Profile
kj800x / Hacking the LG Monitor's
Last active July 22, 2024 16:41
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

To embed the contents of an SVG file into your site using NextJS 12 with the new Rust-based compiler, perform the following steps:

  1. Install @svg/webpack:
$ npm install --save-dev @svgr/webpack
  1. Create a svgr.config.js config file with the following contents. This will remove the width and height from the SVG but keep the viewBox for correct scaling.
pom421 / form-next-ts-rhf-zod-demo.tsx
Last active December 22, 2023 16:28
Form with React Hook form and zod rules (Next.js page example)
// try it :
import React from "react";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { z } from "zod";
import type { FieldError } from "react-hook-form";
// JSON.stringify(error) will not work, because of circulare structure. So we need this helper.
adriang133 / ToggleHDRCatalina.applescript
Last active May 3, 2021 13:22 — forked from lexrus/ToggleHDRCatalina.applescript
Workaround the HDR bug of macOS Catalina 10.15.4
tell application "System Preferences"
end tell
tell application "System Events"
tell process "System Preferences"
delay 1
click menu item "Displays" of menu "View" of menu bar 1
IanColdwater / twittermute.txt
Last active July 2, 2024 02:25
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here:
# Have you ever had multiple branches stacked on top of each other waiting for code review
# and need to merge origin/master (or some other change) up the chain through each of them.
# This script will do that!
# Example: merge_through_each master branch_parent branch_child branch_grand_child
run_command () {
echo ""
echo "running: $@"
if ! $@
shilman /
Last active May 28, 2024 17:42
Storybook Docs Typescript Walkthrough

Storybook Docs w/ CRA & TypeScript

This is a quick-and-dirty walkthrough to set up a fresh project with Storybook Docs, Create React App, and TypeScript. If you're looking for a tutorial, please see Design Systems for Developers, which goes into much more depth but does not use Typescript.

The purpose of this walkthrough is a streamlined Typescript / Docs setup that works out of the box, since there are countless permutations and variables which can influence docs features, such as source code display, docgen, and props tables.

Step 1: Initialize CRA w/ TS

npx create-react-app cra-ts --template typescript
gustavwennerblom / gist:b17a6b8c12a6e10f88306ad3e42f26bd
Last active November 23, 2022 23:43
Adding prettier to a CRA project

Adding prettier to a CRA project

Previously, I've had some problem to reliaby configure code formatting with Prettier in VSCode, in the context of a create-react-app proejct. Today, it worked like a charm, and this is what I did.


  • react-scripts: "3.1.1"
  • react: "^16.9.0"
  • react-dom: "^16.9.0"
  • Dirk Baeumer's ESLint VSCode extension installed and running
onecrayon / Pipfile
Last active July 25, 2021 09:32
async/await FastAPI with SQLAlchemy test
name = "pypi"
url = ""
verify_ssl = true
pylint = "*"
sqlalchemy = "*"
zmts /
Last active August 27, 2020 08:55
Configure AWS SDK with Digital Ocean endpoint; S3

Configure AWS SDK with Digital Ocean endpoint

const AWS = require('aws-sdk')
const spacesEndpoint = new AWS.Endpoint('');

const s3 = new AWS.S3({
    endpoint: spacesEndpoint,
    accessKeyId: 'ACCESS_KEY',
 secretAccessKey: 'SECRET_KEY'