Skip to content

Instantly share code, notes, and snippets.

View wilsonehusin's full-sized avatar
🍜

Wilson E. Husin wilsonehusin

🍜
View GitHub Profile
@wilsonehusin
wilsonehusin / counterStore.ts
Created October 18, 2023 02:41
Example of integrating Svelte store with localStorage which persists across tabs.
import { writable } from "svelte/store";
const key = "myKey"
const defaultValue = "myDefaultValue"
// Fetch value from storage, if any. Otherwise, use defaultValue.
const initialValue = localStorage.getItem(key) || defaultValue;
// Initialize writable instance with initial value.
const store = writable(initialValue);
@wilsonehusin
wilsonehusin / badhmac.go
Last active February 12, 2022 04:45
Bad HMAC with Nonce in Go
package main
import (
"crypto/hmac"
"crypto/rand"
"crypto/sha256"
"fmt"
)
func main() {
@wilsonehusin
wilsonehusin / keybase.md
Last active April 13, 2017 18:03
Keybase

Keybase proof

I hereby claim:

  • I am wilsonehusin on github.
  • I am wilsonehusin (https://keybase.io/wilsonehusin) on keybase.
  • I have a public key ASBKv3T3YbyejUXww6ea_J4O5zAq_KeqCNwIBCPHXt-hQQo

To claim this, I am signing this object: