Skip to content

Instantly share code, notes, and snippets.

View jaybuidl's full-sized avatar
📐

jaybuidl jaybuidl

📐
View GitHub Profile
@jaybuidl
jaybuidl / signature-fun.sh
Last active June 19, 2023 16:20
Once Foundry is installed, the script uses cast to generate a burner wallet stored in an unencrypted keystore file under ./test-keystore/, then it signs and verifies a "hello world!" message.
#!/usr/bin/env bash
# cast is required: https://book.getfoundry.sh/getting-started/installation
[ ! -x "$(command -v cast)" ] && echo "cast is not installed, please run 'curl -L https://foundry.paradigm.xyz | bash'." && exit 1
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
ETH_KEYSTORE_DIR=$SCRIPT_DIR/test-keystore
if [ ! -d "$ETH_KEYSTORE_DIR" ]; then
echo "Creating test keystore"
@jaybuidl
jaybuidl / create-volume-group.sh
Last active June 18, 2023 17:10
APFS volume group creation
# Lookup your existing disks and volumes
diskutil apfs list
# We will modify diskX
disk=diskX
# Assuming that the volume diskXs1 already exist, we need to mark it as a data volume before adding it to a group.
diskutil apfs chrole ${disk}s1 D
# The volume group cannot be created directly. It will be created during the creation of the 2nd volume.
@jaybuidl
jaybuidl / curate-get.sh
Last active April 29, 2022 17:26
Get information about an Ethereum contract address from Kleros Curate
#!/bin/bash
if [[ ! "$1" ]]
then
echo "Usage: $(basename $0) [address]"
exit 1
fi
address=$1
@jaybuidl
jaybuidl / settings.json
Created January 11, 2022 18:09
VS Code settings allowing the integrated terminal to use an upgraded bash installed from brew
{
"terminal.integrated.profiles.osx": {
"Bash (from brew)": {
"path": "/usr/local/bin/bash",
"args": ["-l"]
}
},
"terminal.integrated.defaultProfile.osx": "Bash (from brew)"
}
import { ethers } from "hardhat";
async function main() {
let abi = `[{"constant":false,"inputs":[{"name":"_pinakion","type":"address"}],"name":"changePinakion","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"RNBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"disputesWithoutJurors","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"passPhase","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"governor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastDelayedSetStake","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_d
@jaybuidl
jaybuidl / list-kleros-dependants.sh
Last active December 14, 2021 15:16
Shows the dependencies between Kleros NPM packages
#!/bin/bash
npm list -g npm-dependants || npm install -g npm-dependants
for p in $(npm search @kleros --parseable | cut -f1 | sort)
do
echo $p
npm-dependants $p | sed 's/^/├─ /g'
echo
done
@jaybuidl
jaybuidl / mermaid-plugin.webpack.js
Created October 7, 2021 12:40
drawio_mermaid_plugin
This file has been truncated, but you can view the full file.
/*! For license information please see mermaid-plugin.webpack.js.LICENSE.txt */
(()=>{var t={9609:t=>{"use strict";var e=/^(%20|\s)*(javascript|data)/im,n=/[^\x20-\x7E]/gim,r=/^([^:]+):/gm,i=[".","/"];t.exports={sanitizeUrl:function(t){if(!t)return"about:blank";var a,o,s=t.replace(n,"").trim();return function(t){return i.indexOf(t[0])>-1}(s)?s:(o=s.match(r))?(a=o[0],e.test(a)?"about:blank":s):"about:blank"}}},4949:(t,e,n)=>{t.exports={graphlib:n(6614),dagre:n(6478),intersect:n(8114),render:n(5787),util:n(8355),version:n(5689)}},9144:(t,e,n)=>{var r=n(8355);function i(t,e,n,i){var a=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");r.applyStyle(a,n[i+"Style"]),n[i+"Class"]&&a.attr("class",n[i+"Class"])}t.exports={default:i,normal:i,vee:function(t,e,n,i){var a=t.append(
@jaybuidl
jaybuidl / autossh.service
Created February 18, 2020 08:13 — forked from thomasfr/autossh.service
Systemd service for autossh
[Unit]
Description=Keeps a tunnel to 'remote.example.com' open
After=network.target
[Service]
User=autossh
# -p [PORT]
# -l [user]
# -M 0 --> no monitoring
# -N Just open the connection and do nothing (not interactive)
//install ipfs-cluster
cd $HOME
wget https://dist.ipfs.io/go-ipfs/v0.4.14-rc1/go-ipfs_v0.4.14-rc1_linux-amd64.tar.gz
tar xf go-ipfs_v0.4.14-rc1_linux-amd64.tar.gz
sudo mv go-ipfs/ipfs /usr/local/bin/ipfs
ipfs init
//installing go
cd $HOME/ && wget https://storage.googleapis.com/golang/go1.10.1.linux-amd64.tar.gz
@jaybuidl
jaybuidl / OrderTest.java
Last active January 11, 2019 17:09
Expected behaviour of order entry by units or amount, input validation and 2-ways conversion
import org.junit.jupiter.api.Test;
import java.math.BigDecimal;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
public
class OrderTest
{