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

Keybase proof

I hereby claim:

  • I am v0d1ch on github.
  • I am v0d1ch (https://keybase.io/v0d1ch) on keybase.
  • I have a public key whose fingerprint is 6397 5B1D A68A C22A 4F1C F1E5 9F24 F037 7283 01FA

To claim this, I am signing this object:

@v0d1ch
v0d1ch / Test.hs
Created July 20, 2021 08:32
Plutus contract (payout not working)
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
@v0d1ch
v0d1ch / shell.nix
Created August 23, 2020 21:31
Nix shell with pinned unstable channel and hoogle
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc883", withHoogle ? true }:
let
inherit (nixpkgs) pkgs;
pinnedUnstable =
pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs-channels";
rev = "c59ea8b8a0e7f927e7291c14ea6cd1bd3a16ff38";
sha256 = "1ak7jqx94fjhc68xh1lh35kh3w3ndbadprrb762qgvcfb8351x8v";
};
@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 / Vec3.hs
Last active February 21, 2019 21:16
data Vec3 a = Vec3 a a a deriving (Eq, Show)
instance Functor Vec3 where
fmap f (Vec3 a b c) = Vec3 (f a) (f b) (f c)
instance Applicative Vec3 where
pure a = Vec3 a a a
(Vec3 f f' f'') <*> (Vec3 a b c) = Vec3 (f a) (f' b) (f'' c)
instance Foldable Vec3 where
@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
@v0d1ch
v0d1ch / cps.hs
Last active January 21, 2019 21:36
CPS haskell
cpsTail :: [a] -> o -> ([a] -> o) -> o
cpsTail [] d = \f -> d
cpsTail (a:as) d = \f -> f as
cpsLoop :: (forall o. [a] -> o -> ([a] -> o) -> o) -> [a] -> [a]
cpsLoop f l = f l l id
safeTail :: [a] -> Maybe [a]
# 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.