Skip to content

Instantly share code, notes, and snippets.

View SpiralOutDotEu's full-sized avatar
🤯
If ZK hasn't profoundly shocked you, you haven't understood it yet

Nikos Koumbakis SpiralOutDotEu

🤯
If ZK hasn't profoundly shocked you, you haven't understood it yet
View GitHub Profile
@SpiralOutDotEu
SpiralOutDotEu / EthersTxGasCalculations.js
Last active February 26, 2024 17:35
Ethers calculate transaction fee
import { ethers } from "ethers";
// Using this if cannot serialize bigint
BigInt.prototype.toJSON = function () {
const int = Number.parseInt(this.toString());
return int ?? this.toString();
};
// Define provider
const provider = new ethers.JsonRpcProvider(RPC_URL)
@SpiralOutDotEu
SpiralOutDotEu / TheGovernor.sol
Last active November 7, 2023 23:04
erc721a DAO
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/governance/Governor.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorSettings.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorTimelockControl.sol";

Conventional Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default

@SpiralOutDotEu
SpiralOutDotEu / TheAttacker.sol
Last active August 17, 2023 13:29
A minimal Reentrancy solidity example
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
// Reference: https://www.quicknode.com/guides/ethereum-development/smart-contracts/a-broad-overview-of-reentrancy-attacks-in-solidity-contracts#explaining-reentrancy-with-custom-solidity-contracts
import "./TheBank.sol";
contract TheAttacker {
TheBank public theBank;
constructor(address _thebankAddress) {
@SpiralOutDotEu
SpiralOutDotEu / elgafar-1.env
Last active September 22, 2022 18:41
Stargaze network parameters
export CHAIN_ID="elgafar-1"
export TESTNET_NAME="elgafar-1"
export FEE_DENOM="ustars"
export STAKE_DENOM="ustars"
export GENESIS_URL="https://raw.githubusercontent.com/CosmWasm/testnets/master/malaga-420/config/genesis.json"
export RPC="https://rpc.elgafar-1.stargaze-apis.com:443"
@SpiralOutDotEu
SpiralOutDotEu / index.html
Created May 2, 2022 12:16
Python Script Inside HTML
<html>
<head>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.min.js"></script>
<py-env>
- numpy
- matplotlib
</py-env>
</head>
@SpiralOutDotEu
SpiralOutDotEu / remove_wrong_jpeg.py
Created September 13, 2020 18:18
python script to identify those fault jpg images in a directory.
import glob
import os
import re
import logging
import traceback
filelist=glob.glob("/path/to/*.jpg")
for file_obj in filelist:
try:
<annotation>
<folder>VOC2009</folder>
<filename>2007_000027.jpg</filename>
<source>
<database>The VOC2007 Database</database>
<annotation>PASCAL VOC2007</annotation>
<image>flickr</image>
</source>
<size>
<width>486</width>
@SpiralOutDotEu
SpiralOutDotEu / gist:12ce0c55126c3b9003d214ee123bbe5d
Created March 22, 2020 17:59
convert video so that works with DaVinci Resolve in linux
ffmpeg -i <input> -c:v mpeg4 -force_key_frames "expr:gte(t,n_forced*1)" -c:a pcm_s16le <output>.mov