Skip to content

Instantly share code, notes, and snippets.

View v0d1ch's full-sized avatar
:octocat:
compiling...

Sasha Bogicevic v0d1ch

:octocat:
compiling...
View GitHub Profile
@v0d1ch
v0d1ch / wallet_from_mnemonic.sh
Created May 11, 2024 17:22 — forked from cardano-apexpool/wallet_from_mnemonic.sh
Extract the keys from the mnemonic for a Cardano wallet
#!/bin/bash
# For mainnet
NET="mainnet"
NET_WITH_PREFIX="--mainnet"
# For preprod
#NET="testnet"
#NET_WITH_PREFIX="--testnet-magic 1"
# For preview
@v0d1ch
v0d1ch / lenses.hs
Created February 22, 2019 11:36 — forked from dminuoso/lenses.hs
traverseX :: forall f. Functor f = (a -> f a) -> Vec3 a -> f (Vec3 a)
traverseX f (Vec3 x y z) = (\h -> Vec3 h) <$> f x
traverseY :: forall f. Functor f = (a -> f a) -> Vec3 a -> f (Vec3 a)
traverseY f (Vec3 x y z) = (\h -> Vec3 h) <$> f x
traverseZ :: forall f. Functor f = (a -> f a) -> Vec3 a -> f (Vec3 a)
traverseZ f (Vec3 x y z) = (\h -> Vec3 h) <$> f x
type Lens s a = forall f. Funtor f => (a -> f a) -> s -> f s
@v0d1ch
v0d1ch / store.hs
Last active February 5, 2019 14:47 — forked from dminuoso/store.hs
data Store s a = Store (s -> a) s
instance Comonad (Store s) where
extract :: Store s a -> a
extract (Store f s) = f s
-- "replacing all values with containers, and then consuming those containers again"
extend :: Store s a -> (Store s a -> b) -> Store s b
extend s f = fmap f $ duplicate s
-- verbose: Store (\x -> f' $ Store f x) s
# Basic commands
:Git [args] # does what you'd expect
all of your `~/.gitconfig` aliases are available.
:Git! [args] # same as before, dumping output to a tmp file
Moving inside a repo.
@v0d1ch
v0d1ch / yesodaccount-custom.hs
Created April 15, 2017 14:36 — forked from stla/authaccountcustom.hs
Yesod Auth Account custom login page
{-# LANGUAGE QuasiQuotes, TypeFamilies, GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleContexts, FlexibleInstances, TemplateHaskell, OverloadedStrings #-}
{-# LANGUAGE GADTs, MultiParamTypeClasses, TypeSynonymInstances #-}
import Data.Text (Text)
import Data.ByteString (ByteString)
import Database.Persist.Sqlite
import Control.Monad.Logger (runStderrLoggingT)
import Yesod
import Yesod.Auth