Skip to content

Instantly share code, notes, and snippets.

[
{
"inputs": [
{
"internalType": "contract ICoWSwapSettlement",
"name": "_cowSwapSettlement",
"type": "address"
},
{
"internalType": "contract IWrappedNativeToken",
@edwardstock
edwardstock / gpg_guide.md
Last active April 2, 2024 10:32
GPG Simple Usage Guide

Define config for quick generation

gpg --default-new-key-algo "ed25519/cert,sign+cv25519/encr" --quick-generate-key "my@email.com"

Generate key

gpg --gen-key

  • Set realname: Name Surname
  • Set eamil: mail@mailbox.up
  • Set strong password
@edwardstock
edwardstock / gir-reset-all.sh
Created February 8, 2022 07:46 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@edwardstock
edwardstock / update_alternatives_python.sh
Created February 7, 2022 10:48
Update Alternatives Python 2/3 Example
#!/usr/bin/env bash
# install
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 2
# list
update-alternatives --list python
# change
update-alternatives --config python
@edwardstock
edwardstock / aes256.cpp
Created November 8, 2020 15:41
C++ OpenSSL AES256 encryption
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <memory>
#include <stdexcept>
#include <cstring>
#include <openssl/aes.h>
#include <openssl/err.h>
@edwardstock
edwardstock / conan_fallback.cmake
Created December 13, 2019 16:33
If conan not enabled, trying to find system library of using local subdirectory
function (conan_fallback)
set(options)
set(single NAME LOCAL_INCLUDE_DIR SUBDIR SYSTEM_INCLUDE_DIR TARGET_NAME LOCAL_LIBS_PREFIX)
set(multi PROPERTIES)
cmake_parse_arguments("FF" "${options}" "${single}" "${multi}" ${ARGN})
if (TARGET CONAN_PKG::${FF_NAME})
return()
endif ()
@edwardstock
edwardstock / minter-sdk-java.md
Last active September 8, 2020 14:22
Minter SDK in pure Java

How to use Minter Android SDK within pure Java/Kotlin project

  1. Download required SDK from official bintray repository: https://bintray.com/minterteam/android
  2. There are 4 files:
    • *-javadoc.jar
    • *-sources.jar
    • *.aar
    • *.pom

You need *.aar one.

@edwardstock
edwardstock / boost_build.sh
Last active December 11, 2018 12:14
Boost automated build script
#!/usr/bin/env bash
set -o xtrace
# https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz
BOOST_MAJOR_VER="1"
BOOST_MINOR_VER="68"
BOOST_PATCH_VER="0"
BOOST_VER="${BOOST_MAJOR_VER}.${BOOST_MINOR_VER}.${BOOST_PATCH_VER}"
BOOST_VER_US="${BOOST_MAJOR_VER}_${BOOST_MINOR_VER}_${BOOST_PATCH_VER}"
@edwardstock
edwardstock / README.md
Last active December 9, 2018 21:47
How to create DEB package

Step-By-Step guide how to create .deb file from your files

  1. sudo apt-get install devscripts build-essential lintian
  2. Create a directory with prebuild binaries, for example: myproj_1.0.0.orig
  3. myproj_1.0.0.orig must contains a linux file structure, for exampel: binaries should be in myproj_1.0.0.orig/usr/bin, libraries in usr/lib or usr/lib64 et cetera..
  4. Create tar.gz from directory: tar -zcvf myproj_1.0.0.orig.tar.gz myproj_1.0.0.orig
  5. cd myproj_1.0.0.orig
  6. mkdir debian
  7. dch --create -v 1.0.0-1 --package myproj - this command may ask you about preferred editor, select one
  8. Write changelog respecting syntax:
@edwardstock
edwardstock / FFMpegProgress.java
Last active December 12, 2020 22:50
FFmpeg progress parsing regular expression (with named groups)
public class FFMpegProgress {
// raw
// frame=\s*(?<nframe>[0-9]+)\s+fps=\s*(?<nfps>[0-9\.]+)\s+q=(?<nq>[0-9\.-]+)\s+(L?)\s*size=\s*(?<nsize>[0-9]+)(?<ssize>kB|mB|b)?\s*time=\s*(?<sduration>[0-9\:\.]+)\s*bitrate=\s*(?<nbitrate>[0-9\.]+)(?<sbitrate>bits\/s|mbits\/s|kbits\/s)?.*(dup=(?<ndup>\d+)\s*)?(drop=(?<ndrop>\d+)\s*)?speed=\s*(?<nspeed>[0-9\.]+)x
private final static Pattern PATTERN_S = Pattern.compile("" +
"frame=\\s*(?<nframe>[0-9]+)\\s+" +
"fps=\\s*(?<nfps>[0-9\\.]+)\\s+" +
"q=(?<nq>[0-9\\.-]+)\\s+(L?)\\s*" +
"size=\\s*(?<nsize>[0-9]+)(?<ssize>kB|mB|b)?\\s*" +
"time=\\s*(?<sduration>[0-9\\:\\.]+)\\s*" +
"bitrate=\\s*(?<nbitrate>[0-9\\.]+)(?<sbitrate>bits\\/s|mbits\\/s|kbits\\/s)?.*" +