Skip to content

Instantly share code, notes, and snippets.

View itzaks's full-sized avatar

Isak ✏ ⇝ itzaks

View GitHub Profile
@itzaks
itzaks / config.txt
Created January 10, 2017 16:43
Raspberry /boot/config.txt details for GPU perf. RPI1 B+ 512MB
# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=1
hdmi_mode=4
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
hdmi_drive=2
#uncomment to overclock the arm. 700 MHz is the default.
@itzaks
itzaks / useAsyncState.ts
Created December 5, 2022 12:37
useAsyncState composable for fetching asyncdata in composables
import { Ref } from "vue"
interface AsyncStateOptions<T, O> {
transform?: (input: T) => O
}
interface AsyncStateReturnType<T> {
execute: () => Promise<void>,
refresh: () => Promise<void>,
pending: Ref<boolean>,
@itzaks
itzaks / EditableTextCell.tsx
Last active August 25, 2023 17:24
Editable cells for Payload CMS
import React from "react";
import { useRef, useState, useEffect } from "react"
import { type Props } from "payload/components/views/Cell"
import { useConfig } from "payload/dist/admin/components/utilities/Config"
const DEBOUNCE_UPDATE_MS = 1500
const EditableTextCell: React.FC<Props> = (props) => {
const { field, collection, cellData, rowData } = props