Skip to content

Instantly share code, notes, and snippets.

View GabrielNicolasAvellaneda's full-sized avatar
🎯
Focusing

Gabriel Nicolas Avellaneda GabrielNicolasAvellaneda

🎯
Focusing
View GitHub Profile
@GabrielNicolasAvellaneda
GabrielNicolasAvellaneda / introrx.md
Created November 25, 2015 03:02 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
const partition = (list, partitioner) => {
const toIndex = (el) => (partitioner(el)) ? 0 : 1;
const toPartition = (result, el) => {
result[toIndex(el)].push(el)
return result;
}
return list.reduce(toPartition, [[],[]]);
}
@GabrielNicolasAvellaneda
GabrielNicolasAvellaneda / minikube-start.sh
Created December 6, 2018 16:59
Minikube 8 Cpus 32Gb of RAM
#!/bin/bash
minikube start --memory $(expr 32 \* 1024) --cpus 8
@GabrielNicolasAvellaneda
GabrielNicolasAvellaneda / .gitignore
Created May 5, 2020 17:43
[GIT ignore all but a specific folder]
/*
!/some-folder
@GabrielNicolasAvellaneda
GabrielNicolasAvellaneda / sqlite-tables.sh
Created May 5, 2020 17:55
[sqlite shell to list tables]
sqlite3 file.db
.TABLES
{
"data": {
"datasets": [
{
"backgroundColor": [
"rgb(255, 99, 132)",
"rgb(54, 162, 235)",
"rgb(255, 205, 86)"
],
"data": [
@GabrielNicolasAvellaneda
GabrielNicolasAvellaneda / Playground.hs
Last active March 29, 2021 01:27
Plutus Playground Smart Contract
-- Get the PubKeyHash type
import Control.Monad (void)
import Ledger
import Data.Aeson (FromJSON, ToJSON)
import qualified Language.PlutusTx as PlutusTx
import qualified Ledger.Ada as Ada
import qualified Ledger.Typed.Scripts as Scripts
import Wallet.Emulator.Wallet
import Playground.Contract
import qualified Data.Text as T
@GabrielNicolasAvellaneda
GabrielNicolasAvellaneda / Playground.hs
Created March 29, 2021 02:23
Plutus Playground Smart Contract
-- A game with two players. Player 1 thinks of a secret word
-- and uses its hash, and the game validator script, to lock
-- some funds (the prize) in a pay-to-script transaction output.
-- Player 2 guesses the word by attempting to spend the transaction
-- output. If the guess is correct, the validator script releases the funds.
-- If it isn't, the funds stay locked.
import Control.Monad (void)
import qualified Data.ByteString.Char8 as C
import Language.Plutus.Contract
import qualified Language.PlutusTx as PlutusTx
@GabrielNicolasAvellaneda
GabrielNicolasAvellaneda / shelley_staking_gen.md
Created May 16, 2021 04:11 — forked from ilap/shelley_staking_gen.md
Extracting Pool Staking keys from Daedalus/Yoroi wallet

Intorduction

DISCLAIMER: NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK

UPDATED: 14:08am AEST 29/Sept/2020, The IDX was incorrectly used. Fixed now

There are two keypairs that are required to register a pool:

  1. reward account (costs and rewards) and
  2. owner stake (pledge) keypair.
#!/bin/bash
function cardano-address-init() {
WALLETS_DIR=${HOME}/.cardano/wallets
MNEMONICS_SIZE=24
}
function cardano-address-testnet-init() {