Skip to content

Instantly share code, notes, and snippets.

View waynevanson's full-sized avatar
🥥

Wayne Van Son waynevanson

🥥
View GitHub Profile
@benbr8
benbr8 / async_await.py
Last active December 24, 2023 00:04
Everything there is to know about Python async/await (without asyncio)
class Counter:
def __init__(self, n=3) -> None:
self.n = n
self._cnt = 0
def __await__(self):
for _ in range(self.n):
r = yield self._cnt
print(f"incrementing by {r}")
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DeriveFunctor #-}
module RapidCheck where
import Data.List
import Data.Monoid((<>))
import System.Random
import Text.Show.Functions
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active May 25, 2024 05:56
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
# generate new personal ed25519 ssh key
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network
eval "$(ssh-agent -s)"