Skip to content

Instantly share code, notes, and snippets.

View grikomsn's full-sized avatar

Griko Nibras grikomsn

View GitHub Profile
@bdsqqq
bdsqqq / vesper-dark.json
Last active April 1, 2024 17:44
Vesper theme for zed.dev
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"name": "Vesper",
"author": "Rauno Freiberg",
"themes": [
{
"name": "Vesper",
"appearance": "dark",
"style": {
"border": "#101010",
@milesrichardson
milesrichardson / result.md
Created November 16, 2023 12:51
OpenAI generated this code from a UX mockup at https://makereal.tldraw.com/
We couldn’t find that file to show.
import * as React from 'react';
const useIsFirstRender = (): boolean => {
const isFirst = React.useRef(true);
if (isFirst.current) {
isFirst.current = false;
return true;
} else {
@LiquidityC
LiquidityC / Makefile
Last active December 1, 2023 03:24
Generic drop in Makefile
VERSION = \"1.0.0\"
PREFIX ?= out
INCDIR = inc
SRCDIR = src
LANG = c
OBJDIR = .obj
MODULE = binary_name
CC = gcc
@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
@nickmccurdy
nickmccurdy / page.tsx
Last active December 31, 2023 14:59
RSC streaming using recursive promises https://twitter.com/shuding_/status/1681373460860108810
async function Row({ chunk }) {
const { next, value, done } = await chunk
if (done) return null
return (
<>
{value}
<Row chunk={next} />
</>
)
}
@kconner
kconner / macOS Internals.md
Last active April 22, 2024 21:28
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

export const chaosTestStrings = (): void => {
const textNodes = getAllTextNodes(document.body);
for (const node of textNodes) {
const textNodeLength = node.textContent ? node.textContent.length : 0;
if (node.textContent === null) {
return;
}
if (node.parentElement instanceof Element) {
if (node.parentElement.dataset.originalText === undefined) {
import * as React from 'react'
import { SpringValue, easings, useSpring } from 'react-spring'
/**
* Hook that animates height when args.animationKey changes
*
* Ex:
* const animatedBlock = useAnimatedHeight({
* animationKey: key,
* })
// TODO: make `pages` optional and measure the div when unspecified, this will
// allow more normal document flow and make it easier to do both mobile and
// desktop.
import {
createContext,
useCallback,
useContext,
useEffect,
useMemo,
useRef,