This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import rebound | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
def add_galactic_potential(sim, mass_distribution): | |
""" | |
Simplified function to simulate the galactic potential effect on the simulation. | |
This function modifies the velocities of particles to simulate a basic galactic potential. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Modified to run both (redudantly, yes, I know, I am paranoid, you should be too) checks | |
# | |
set -eu | |
# find path to liblzma used by sshd | |
path="$(ldd $(which sshd) | grep liblzma | grep -o '/[^ ]*')" | |
echo 'Check one: does it even exist?' | |
# does it even exist? | |
if [ "$path" == "" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.4; | |
interface IERC20 { | |
function approve(address spender, uint256 amount) external returns (bool); | |
} | |
interface IERC3156FlashBorrower { | |
function onFlashLoan( | |
address initiator, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SPDX-License-Identifier: Unlicense | |
pragma solidity ^0.8.0; | |
pragma abicoder v2; | |
import "@uniswap/v2-periphery/contracts/interfaces/IWETH.sol"; | |
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol"; | |
import "@uniswap/v3-core/contracts/libraries/LowGasSafeMath.sol"; | |
import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; | |
import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol"; | |
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
contract TestStateChange { | |
uint public originalValue = 123; | |
uint public oldValue; | |
uint public incrementer = 0; | |
bytes4 public constant CHANGE_SEL = bytes4(keccak256(bytes('changeState(uint256)'))); | |
bytes4 public constant WRAP_CHANGE_SEL = bytes4(keccak256(bytes('wrapChangeState(uint256)'))); | |
error CallFailedError(string reason,address msgSender,address txOrigin); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
// 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2 | |
contract TestExec { | |
address owner; | |
constructor() { | |
owner = msg.sender; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import json | |
import aiohttp | |
class AsyncHttpClient: | |
def __init__(self, _headers=None, base_url: str = None, timeout: (int, float) = 60): | |
""" | |
A skeletal asynchronous HTTP class. Because I found myself writing this same code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Python 3.7 or higher required due to the use of asyncio.run() | |
import argparse | |
import asyncio, json, ssl | |
import math | |
import os | |
import json | |
import re | |
import websocket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo 'Changing directories ... ' | |
cd /opt/ProtonTestnet/protonNode | |
echo "Delete old snaps" | |
rm snapshots/* | |
echo "Downloading latest snap " | |
cd snapshots | |
wget https://backup.cryptolions.io/ProtonTestNet/snapshots/latest-snapshot.bin.zst | |
unzstd latest-snapshot.bin.zst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import logging | |
import os | |
from web3.middleware import geth_poa_middleware | |
import utils.termstyle | |
import web3 | |
cp = utils.termstyle.ColorPrinter(0) |
NewerOlder