Skip to content

Instantly share code, notes, and snippets.

View amanelis's full-sized avatar
🧙‍♀️

amanelis

🧙‍♀️
View GitHub Profile
@amanelis
amanelis / garage.py
Last active February 19, 2020 19:00
My raspberryPI python Twilio code to trigger a command / garage door
import time
import datetime
from datetime import date
from twilio.rest import Client
from subprocess import call
print("Garage loop, starting...")
client = Client('account_sid', 'account_token')
@amanelis
amanelis / alembic.ini
Created January 16, 2019 18:42
Better migration file naming for Alembic
[alembic]
# path to migration scripts
script_location = alembic
# template used to generate migration files
file_template = %%(year)d%%(month).2d%%(day).2d%%(hour).2d%%(minute).2d%%(second).2d_%%(rev)s_%%(slug)s
# timezone to use when rendering the date
# within the migration file as well as the filename.
# string value is passed to dateutil.tz.gettz()
@amanelis
amanelis / Makefile
Last active January 15, 2020 18:27
Makefile for Minikube
# Minikube local development
################################################################################
minikube-up: minikube-start minikube-install
minikube-down: minikube-uninstall minikube-delete
setup_dashboard:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta6/aio/deploy/recommended.yaml
minikube-dashboard:
@minikube dashboard
@amanelis
amanelis / EIP712.sol
Created March 5, 2021 22:26 — forked from anubhavgirdhar/EIP712.sol
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=false&gist=
pragma solidity ^0.5.0;
contract EIP712 {
mapping(address => uint256) public nonces;
struct EIP712Domain {
string name;
string version;
uint256 chainId;
@amanelis
amanelis / fremont_covid_vaccine.rb
Created April 11, 2021 17:35
A quick ruby script for checking COVID-19 Vaccine in Fremont, California
require 'rubygems'
require 'nokogiri'
require 'open-uri'
puts "COVID Vaccine Finder / Fremont, California"
page = Nokogiri::HTML(open(URL))
mDiv = "body > div > div.shadow-sm.p-3.mb-4.rounded > div:nth-child(8) > div"
bDiv = "button"
@amanelis
amanelis / geth.service
Created October 2, 2021 20:39
geth standard fast configuration
# /etc/systemd/system/geth.service
[Unit]
Description=Go Ethereum Client
After=network.target
Wants=network.target
[Service]
User=goeth`
Group=goeth
package main
import (
"context"
"fmt"
"io/ioutil"
"net/http"
neturl "net/url"
"time"
)
@amanelis
amanelis / ethereum_keys.sh
Created July 13, 2022 05:32 — forked from miguelmota/ethereum_keys.sh
Generate Ethereum Private key, Public key, and Address using Bash and OpenSSL
# Generate the private and public keys
openssl ecparam -name secp256k1 -genkey -noout | openssl ec -text -noout > key
# Extract the public key and remove the EC prefix 0x04
cat key | grep pub -A 5 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^04//' > pub
# Extract the private key and remove the leading zero byte
cat key | grep priv -A 3 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^00//' > priv
# Generate the hash and take the address part
@amanelis
amanelis / Multicall.sol
Created August 11, 2022 22:42 — forked from 0xAlcibiades/Multicall.sol
A Pre EIP-1559 MEV/Multicall in pure Yul integrated with ApeBank and with Native GasTokens
// SPDX-License-Identifier: MIT
object "Multicall" {
code {
// Deploy the contract
// Store gas token burn cost in zero slot
sstore(0, 0)
sstore(1, 0)
sstore(2, 0)
datacopy(0x0, dataoffset("MulticallRuntime"), datasize("MulticallRuntime"))
@amanelis
amanelis / arbitrage.py
Created August 22, 2022 17:54 — forked from noxx3xxon/arbitrage.py
CFMM Routing Arbitrage Example
import numpy as np
import cvxpy as cp
import itertools
# Problem data
global_indices = list(range(4))
# 0 = TOKEN-0
# 1 = TOKEN-1
# 2 = TOKEN-2