This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env nix-shell | |
| #!nix-shell --pure -p "haskellPackages.ghcWithPackages (pkgs: [])" -i "runghc" | |
| {- | |
| Installing unix signal handler | |
| -} | |
| import Control.Concurrent (threadDelay) | |
| import Control.Concurrent.MVar (MVar, newEmptyMVar, putMVar, | |
| tryTakeMVar) | |
| import System.Posix.Signals (Handler (CatchOnce), installHandler, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Sample left join | |
| -- see for more detail, https://www.tutorialspoint.com/sql/sql-left-joins.htm | |
| -- to execute: | |
| -- sqlite3 ./db < leftjoin.sql | |
| -- | |
| drop table if exists U; | |
| drop table if exists S; | |
| create table if not exists U (address text, txid text, txix int , unique (txid, txix) ); | |
| create table if not exists S (txid text, txix int, unique (txid, txix)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env stack | |
| {- stack | |
| script | |
| --resolver lts-18.28 | |
| --package async | |
| --package optparse-applicative | |
| --package text | |
| -} | |
| import Data.List.NonEmpty (NonEmpty, fromList) | |
| import Data.Semigroup ((<>)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env stack | |
| {- stack | |
| script | |
| --resolver lts-18.28 | |
| --package sqlite-simple | |
| --package async | |
| --package text | |
| -} | |
| {- | |
| -- | the purpose of this code is to make sure sqlite maybe accessed concurrently |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## first node must sync: | |
| ##################################### | |
| $ cardano-cli query tip --mainnet | |
| { | |
| "block": 7937358, | |
| "epoch": 371, | |
| "era": "Babbage", | |
| "hash": "f580eb4778f57fc5dbbd138ebcb89341239447a9438b13dc2eaccf5bb1c34e17", | |
| "slot": 75306292, | |
| "syncProgress": "100.00" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env stack | |
| {- stack | |
| script | |
| --resolver lts-18.28 | |
| --package sqlite-simple | |
| --package async | |
| --package text | |
| -} | |
| {- | |
| -- | the purpose of this code is : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker system prune --volumes | |
| docker system prune --all | |
| _/build-dars | |
| dc up -d --build | |
| find . -name "*.dar" | |
| #### output of the find command: ### | |
| ➜ eleox git:(js-kayvan-EID-17-packageId) ✗ find . -name "*.dar" | |
| ./daml/.daml/dist/eleox-do-not-use-0.0.1.dar | |
| ./daml/.packages/eleox-triggers/.daml/dist/eleox-triggers-0.0.1.dar | |
| ./daml/.packages/eleox/.daml/dist/eleox-0.0.1.dar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Here is my workflow: | |
| $ nix-shell | |
| $ emacs& | |
| from emacs 27.02 (getenv "PATH") | |
| /run/wrapper/bin:/home/kayvan/.nix-profile/bin:/etc/profiles/per-user/kayvan/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin | |
| -------------------------- from zsh echo $PATH --------- | |
| echo $PATH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env stack | |
| {- | |
| stack | |
| --resolver lts-17.13 runghc | |
| --package http-conduit | |
| --package async | |
| -} | |
| -- | |
| -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env stack | |
| {- | |
| stack | |
| --resolver lts-17.13 runghc | |
| --package HTTP | |
| --package http-conduit | |
| -} | |
| -- | |
| -- chapter-10, Parallel-concurrent-programming in haskell |