Skip to content

Instantly share code, notes, and snippets.

@arrlancore
arrlancore / use-persisted-form.ts
Created May 17, 2024 01:09
A custom React Hook Form that persists form data to localStorage. It takes an object containing the form ID, default values, and schema as input and returns a tuple containing the form methods and a clearFormData function. The clearFormData function is used to clear the form data from localStorage. The form data is saved to localStorage whenever…
import { useEffect } from 'react';
import { DefaultValues, FieldValues, Resolver, useForm, UseFormReturn } from 'react-hook-form';
interface UsePersistedFormOptions<TFormValues extends FieldValues> {
formId: string;
defaultValues?: DefaultValues<TFormValues>;
schema?: Resolver<TFormValues>;
}
/**
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@MrMightyNighty
MrMightyNighty / minimal-compose-wekan.yaml
Last active May 17, 2024 01:07
A minimal wekan docker-compose file to start Wekan without a mail server. You will get a "Internal Server Error" if you create your first user but don't worry the user will still be added to the database and you can login without any issues.
version: '2'
services:
wekandb:
#-------------------------------------------------------------------------------------
# ==== MONGODB FROM DOCKER HUB ====
image: mongo:6
#-------------------------------------------------------------------------------------
container_name: wekan-db
restart: always
# command: mongod --oplogSize 128
@jboner
jboner / latency.txt
Last active May 17, 2024 01:05
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active May 17, 2024 01:02
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

#!/bin/sh
# https://github.com/greymechanic/loopVideo
# clear terminal text, set background to black, and hide the cursor
setterm -cursor off
setterm -term linux -background black
setterm -term linux clear
# this is the path to the directory containing your videos
VIDEOPATH="/home/pi/Videos"
{
"id": "51da5b68-7b4b-4bc2-92c9-3fd35ccd61a8",
"name": "Triggered Campaigns Data Extension",
"version": 1,
"appVersion": "9.3.2",
"references": {
"dataExtensions/477f4bed-1da1-ec11-ba36-d4f5ef3de2b5": [
"categories/509296"
],
"categories/509296": []

Checkbox Tables in Markdown

An attempt to make a list of the supported ways to make a table with checkboxes in Markdown.

Results as of October 2023.


Below is the style element that formats the colors of the colored check mark emojis.

@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active May 17, 2024 00:52
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@lgg
lgg / remote-desktop-guide.md
Last active May 17, 2024 00:49
Install Remote Desktop on Jetson Nano

Install remote desktop / remote control for Jetson Nano

Anydesk doesn't support and doesn't work on Jetson Nano (aarch64). So you will need to install VNC, the easiest and fastest is to install the X2Go server. NoMachine, TeamViewer, AnyDesk, OpenVino, VNC, RDP, XRDP, Remote access for Jetson Nano / Xavier.

Installation

  • sudo apt update
  • sudo apt upgrade
  • sudo apt install openssh-server vim git gcc g++ net-tools
  • sudo apt-get install xubuntu-desktop (select lightdm)