Skip to content

Instantly share code, notes, and snippets.

View zoontek's full-sized avatar

Mathieu Acthernoene zoontek

View GitHub Profile
@zoontek
zoontek / 1-setup.md
Created June 24, 2025 14:01 — forked from troyfontaine/1-setup.md
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@zoontek
zoontek / gpg.sh
Created April 7, 2023 08:17
GPG on macOS (compatible with Fork)
$ brew install gnupg
$ brew install pinentry-mac
$ echo "pinentry-program $(which pinentry-mac)" >> ~/.gnupg/gpg-agent.conf
$ killall gpg-agent
import { useSyncExternalStore } from "react";
export type Atom<Value> = {
get: () => Value;
set: (value: Value | ((prevValue: Value) => Value)) => void;
subscribe: (callback: (value: Value) => void) => () => void;
reset: () => void;
};
export const atom = <Value>(initialValue: Value): Atom<Value> => {
import frenchkiss, { TranslationParams } from "frenchkiss";
const en = {
"button.hello": "Hello",
};
type TranslationKey = keyof typeof en;
const fr: { [key in TranslationKey]: string } = {
// Libs internal
type Segment<T> = {
test: (value: unknown) => boolean;
parse: (string: string) => T;
stringify: (value: T) => string;
};
const string: Segment<string> = {
test: (value) => typeof value === "string",
@zoontek
zoontek / match.ts
Created April 15, 2020 14:11
TS match functions
type Key = string | number | symbol;
type ExhaustiveMatch<K extends Key, T> = Record<K, T>;
type PartialMatch<K extends Key, T> = Partial<Record<K, T>> & { _: T };
export const match = <T, K extends Key = Key>(
key: K,
map: ExhaustiveMatch<K, T> | PartialMatch<K, T>,
): T => (map.hasOwnProperty(key) ? map[key] : (map as PartialMatch<K, T>)._) as T;
type ReturnType<F> = F extends (...args: any[]) => infer R ? R : any;
type MemoizeResolver<F extends (...args: any[]) => any> = (
...args: Parameters<F>
) => string;
type MemoizedFuntion<F extends (...args: any[]) => any> = ((
...args: Parameters<F>
) => ReturnType<F>) & {
@zoontek
zoontek / keybase.md
Created March 15, 2017 13:14
keybase.md

Keybase proof

I hereby claim:

  • I am zoontek on github.
  • I am zoontek (https://keybase.io/zoontek) on keybase.
  • I have a public key ASAap_lL6Nf_OF1ZJQwaweIV1PFKNLtNkh3qlp6RlR9d0go

To claim this, I am signing this object: