Skip to content

Instantly share code, notes, and snippets.

View bjing's full-sized avatar

Brian Jing bjing

  • Australia
View GitHub Profile
@bwbush
bwbush / debugging-plutus.md
Last active August 31, 2022 09:30
Debugging Plutus

Debugging Plutus

This example illustrates manually passing serialized data from a Plutus validator and then deserializing it. It uses Plutus.Debug.

Instrument the validator

Change traceIfFalse to Plutus.Debug.debugIfFalse with added arguments containing the data to be passed out of the script. Here we change

traceIfFalse "R" $ any (checkScriptOutput addr hsh value) allOutputs
@mikekeke
mikekeke / PAB_setup.md
Last active January 25, 2023 17:43
PAB setup

Hosted PAB setup

This document describes how to prepare hosted PAB deployment from scratch that can operate on Alonzo purple testnet.

The following required to be run on host machine to use PAB with contracts in hosted scenario on testnet (for 2020-11-05 PAB Release):

  • Cardano node connected to Alonzo testnet
  • cardano wallet connected to node
  • chain-index connected to node
  • PAB executable connected to node, cardano-wallet and chain-index

Note: we are using somewhat more involved setup with a bit custom docker compose, and wallet and chain-index being built from sources, but there is ready to go node+wallet docker solution available

@jkpl
jkpl / Main.scala
Last active February 5, 2024 08:29
Ways to pattern match generic types in Scala
object Main extends App {
AvoidLosingGenericType.run()
AvoidMatchingOnGenericTypeParams.run()
TypeableExample.run()
TypeTagExample.run()
}
class Funky[A, B](val foo: A, val bar: B) {
override def toString: String = s"Funky($foo, $bar)"
}
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@chrisyco
chrisyco / desmume-compiling.md
Created December 13, 2011 05:01
How to compile DeSmuME on Debian or Ubuntu

How to compile DeSmuME on Debian or Ubuntu

(with a mildly condescending tone)

Step 0 (optional)

You can enable fancy optimizations by creating a config.site file. To do this, open your favorite text editor and type: