Skip to content

Instantly share code, notes, and snippets.

View 0xJchen's full-sized avatar
🎯
Focusing

Jiachen Wang 0xJchen

🎯
Focusing
View GitHub Profile
// This is a basic uniswap frontrunning MEV bot
// Made by Merunas follow me on youtube to see how to use it and edit it: https://www.youtube.com/channel/UCJInIwgW1duAEnMHHxDK7XQ
// 1. Setup ethers, required variables, contracts and start function
const { Wallet, ethers } = require('ethers')
const { FlashbotsBundleProvider, FlashbotsBundleResolution } = require('@flashbots/ethers-provider-bundle')
// 1.1 Setup ABIs and Bytecodes
const UniswapAbi = [{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_WETH","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesire
pragma solidity 0.8.0;
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "hardhat/console.sol";
// We need to import the helper functions from the contract that we copy/pasted.
import { Base64 } from "./libraries/Base64.sol";
/**
*Submitted for verification at Etherscan.io on 2021-09-05
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// [MIT License]
/// @title Base64
@buptczq
buptczq / detect.py
Last active January 30, 2022 06:39
QQ URL detect
import hashlib
import struct
import sqlite3
def md5hash(buf):
return hashlib.md5(buf.encode("utf-16")[2:]).digest()
def md5cmp(buf, postfix, a1, a2, a3, a4):
if len(buf) < postfix:
return False
@haleyrc
haleyrc / throttledebounce.go
Last active March 27, 2024 05:31
Throttle and debounce implemented in Go
// This gist is a reminder to myself about the differences between throttling and debouncing, inspired by
// https://redd.one/blog/debounce-vs-throttle
//
// A runnable example is available here: https://play.golang.org/p/sADDu829fRa
package main
import (
"fmt"
"time"
)
@ivanstepanovftw
ivanstepanovftw / vtune-amplifier-install.md
Last active March 1, 2023 12:11
Patch if Intel's shitty installer cant find libraries, but they are presents

If you cannot install Intel VTune Amplifier on Manjaro/Arch Linux (or other non-supported OS), because this shit cannot find installed libraries via ldconfig -p, you can use this script.
Unpack vtune_amplifier_2019_update3.tar.gz, then go to vtune_amplifier_2019_update3, then copy and paste following:

shopt -s globstar

for i in **/sysreq.cab; do
    echo "processing ${i}"
    perl -pi -e 's/(\W*)RESULT=255(.*)/\1RESULT=1  \2/' "${i}"  # COMPARE_VERSIONS() never returns 255
    perl -pi -e 's/(\W*)LI_(.+)=unsupp(.*)/\1LI_\2=ok    \3/' "${i}"
@bluesmilery
bluesmilery / create_virtual_env.sh
Last active May 23, 2021 05:36
[create_virtual_env] Used to create a Anaconda virtual environment for CUDA and TensorFlow. If you want to use this shell script, please read the blog. https://bluesmilery.github.io/blogs/a687003b/
#!/bin/bash
# Used to create a Anaconda virtual environment for CUDA and TensorFlow.
# If you want to use this shell script, please read the blog.
# https://bluesmilery.github.io/blogs/a687003b/
echo ""
echo "This script is used to create a Anaconda virtual environment for CUDA and TensorFlow."
echo ""
read -p "Enter the name of Anaconda virtual environment: " ENV_NAME
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active April 18, 2024 18:06 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话: