Skip to content

Instantly share code, notes, and snippets.

View gitmp01's full-sized avatar

gitmp01

View GitHub Profile
@gitmp01
gitmp01 / main.rs
Created May 15, 2026 16:52
EIP-7702 - Atomic approve + contract call example
//! EIP-7702 demo matching test1.sh:
//! 1. Sign an EIP-7702 authorization delegating to the Alchemy smart wallet.
//! 2. Approve OmniBridge to spend `AMOUNT` of the Aave token.
//! 3. Call OmniBridge.initTransfer for `AMOUNT` to a NEAR recipient.
//! Both inner calls are batched via `executeBatch` in a single type-4 tx.
//!
//! Required env vars:
//! PRIVATE_KEY – hex EOA private key (with or without 0x)
//! RPC_URL – HTTP(S) RPC endpoint (e.g. $QN_BASE)
@gitmp01
gitmp01 / send.sh
Created January 21, 2021 10:32
Send a matic tx
#!/bin/bash
curl -X POST -H 'content-type: application/json' --data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xf94547808504a817c800833d09008080b944f46080604052600080546001600160a01b03191673d216153c06e857cd7f72665e0af1d7d82172f494179055619c40600c553480156200003d57600080fd5b50604051620043d4380380620043d4833981018060405260608110156200006357600080fd5b8101908080516401000000008111156200007c57600080fd5b820160208101848111156200009057600080fd5b8151640100000000811182820187101715620000ab57600080fd5b50509291906020018051640100000000811115620000c857600080fd5b82016020810184811115620000dc57600080fd5b8151640100000000811182820187101715620000f757600080fd5b505092919060200180516401000000008111156200011457600080fd5b820160208101848111156200012857600080fd5b81518560208202830111640100000000821117156200014657600080fd5b505092919050505033333385858582600390805190602001906200016c92919062000581565b5081516200018290600490602085019062000581565b5080516200019890600590602084019062000606565b5060005b600554811015620001fa57600
#!/bin/bash
##
## Use rsync to sync a project to a remote host
## 1. Define the $HOST node
## 2. Define $DST_FOLDER on the remote host
## 3. Execute
##
# We use this instead of $PWD when building through sublimetext
"""Encrypt with Openssl, decrypt with python!
"""
from Crypto.Cipher import AES
from base64 import b64decode
from Crypto.Util.Padding import unpad
from hashlib import sha256
# Command line
@gitmp01
gitmp01 / merge_pdf_osx.sh
Created February 20, 2019 09:22
Merge a set of pdfs using macOS default tool
#!/bin/bash
# Thanks to
# https://gotofritz.net/blog/howto/joining-pdf-files-in-os-x-from-the-command-line/
#
"/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" -o PATH/TO/YOUR/MERGED/FILE.pdf /PATH/TO/ORIGINAL/1.pdf /PATH/TO/ANOTHER/2.pdf /PATH/TO/A/WHOLE/DIR/*.pdf
#!/bin/bash
# Finds alphanumeric char strings 64 chars long
egrep -o "\w{64}"
@gitmp01
gitmp01 / How-to-create-bootable-USB-stick-on-OSX
Created February 9, 2019 18:03
Howto: create bootable USB stick on Mac OS X
How-To: create bootable USB-stick from ISO image:
=================================================
1. Download ISO image file:
wget -o ~/Desktop/mini.iso http://ftp.nl.debian.org/debian/dists/wheezy/main/installer-amd64/current/images/netboot/mini.iso
2. Convert ISO file to DMG format using hdiutil:
hdiutil convert -format UDRW -o Desktop/mini.img Desktop/mini.iso
@gitmp01
gitmp01 / get-script-dir.sh
Last active November 22, 2018 17:37
Get the absolute path of the script executed
#!/bin/bash
abs_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
echo 'abs path: '$abs_path