Skip to content

Instantly share code, notes, and snippets.

View shubhamkumar13's full-sized avatar
πŸ˜‘
is existing

shubham shubhamkumar13

πŸ˜‘
is existing
View GitHub Profile
@shubhamkumar13
shubhamkumar13 / test_lpm.ml
Last active August 1, 2023 14:34
testing lpm by comparing outputs with generated tz files
module Fpath = Fpath
module OS = Bos.OS
module Cmd = Bos.Cmd
open Core
let ( let* ) o f = Result.bind o ~f
let get_tmp_dir () : string = OS.Dir.default_tmp () |> Fpath.to_string
let rm_rf ~(path : string) : unit =
OS.Dir.delete ~must_exist:true ~recurse:true (Fpath.v path) |> function
@shubhamkumar13
shubhamkumar13 / pattern-maching.purs
Created July 20, 2023 09:25
recipe for pattern matching arrays in purescript
f l = case Array.uncons l of
Just {head,tail} -> handle non null case
Nothing -> handle null case
@shubhamkumar13
shubhamkumar13 / bash_test.bash
Created July 17, 2023 11:27
test file for ligo package manager
function github_ssh() {
echo "[email protected]:ligolang/$1.git"
}
function dir() {
echo "$HOME/nuke/test_lpm/$1"
}
DAO_JSLIGO=dao-jsligo
DAO_CAMELIGO=dao-cameligo
@shubhamkumar13
shubhamkumar13 / result.txt
Created July 17, 2023 11:25
the result of tests
Cloning into '/home/sk/nuke/test_lpm/dao-jsligo'...
Cloning into '/home/sk/nuke/test_lpm/dao-cameligo'...
Cloning into '/home/sk/nuke/test_lpm/permit-jsligo'...
Cloning into '/home/sk/nuke/test_lpm/permit-cameligo'...
{ parameter
(or (pair %propose (string %descriptionLink) (option %hash bytes))
(or (option %cancel nat)
(or (nat %lock)
(or (nat %release)
@shubhamkumar13
shubhamkumar13 / remove_esy.ml
Last active June 7, 2023 11:43
a sample code which is on the path to remove esy
module Cohttp_lwt_unix = Cohttp_lwt_unix
module Json = Yojson.Basic
module Cohttp_lwt = Cohttp_lwt
open Lwt.Syntax
open Lwt.Infix
let ( // ) a b = a ^ "/" ^ b
let ligo_package_dir = "." // ".ligo" // "source" // "i"
let baseurl = "https://packages.ligolang.org/-/api/@ligo"
let toplevel_packages = [ ("permit", "1.0.0"); ("fa", "1.0.0") ]
@shubhamkumar13
shubhamkumar13 / notes.md
Created June 1, 2023 08:04
From a beginners perspective
  1. Startup should be before Install taq plugins

    • makes it less confusing for beginners who might get an error This doesn't appear to be a taqueria project. and get stuck.
    • also in the command add a mkdir <insert-dir-name> for a root directory so that they know not to install it in their $HOME or any global scope just as an extra piece of caution
  2. Initialize/create's root directory should be specified helps in understanding where the contract would be created using taq create ... command.

    • maybe let users know it's a template for a counter, helpful context but it's optional.
    • do update the code since it is different from the template generated
       ❯ cat intezos.jsligo
@shubhamkumar13
shubhamkumar13 / learning.rkt
Last active May 28, 2023 00:22
learning lcai in racket
#lang racket
(require test-engine/racket-tests)
; file contains Unicode characters - download rather than cut/paste from browser
;; proust-prop-imp-basic: minimal proof assistant for implicational fragment of propositional logic
;; Prabhakar Ragde (April 2020)
;; Can only check full proof terms, no incremental interactive building here
@shubhamkumar13
shubhamkumar13 / learning.agda
Created April 23, 2023 12:08
my exercises to learn agda
module vec where
open import Data.Product hiding (zip)
data β„• : Set where
zero : β„•
suc : β„• β†’ β„•
data Vec (X : Set) : β„• β†’ Set where
⟨⟩ : Vec X zero
@shubhamkumar13
shubhamkumar13 / merge.py
Created February 14, 2023 23:44
merge 2 dictionaries in python
# dict1 : {
# "a" : 1,
# "b" : "3",
# "c" : (4,),
# "d" : [3],
# "e" : {"f" : 7},
# }
# dict2 : {
# "a" : 2,
# "b" : "4",
@shubhamkumar13
shubhamkumar13 / symlist.rs
Last active November 5, 2022 12:37
Trying to implement algorithm design in rust
use std::collections::VecDeque;
use std::panic;
trait FP<T> {
fn cons(self, x : T) -> VecDeque<T>;
fn snoc(self, x : T) -> VecDeque<T>;
fn tail(self) -> Option<VecDeque<T>>;
fn init(self) -> Option<VecDeque<T>>;
fn head(self) -> Option<T>;
fn last(self) -> Option<T>;