Skip to content

Instantly share code, notes, and snippets.

@BlockmanCodes
BlockmanCodes / 01_deployContracts.js
Created November 22, 2022 01:29
Uniswap V3 Flashloans and Arbitrage
const { Contract, ContractFactory, utils, BigNumber } = require("ethers")
const WETH9 = require("../WETH9.json")
const artifacts = {
UniswapV3Factory: require("@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json"),
SwapRouter: require("@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json"),
NFTDescriptor: require("@uniswap/v3-periphery/artifacts/contracts/libraries/NFTDescriptor.sol/NFTDescriptor.json"),
NonfungibleTokenPositionDescriptor: require("@uniswap/v3-periphery/artifacts/contracts/NonfungibleTokenPositionDescriptor.sol/NonfungibleTokenPositionDescriptor.json"),
NonfungiblePositionManager: require("@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json"),
WETH9,
@colin-h
colin-h / clog-the-log.code-snippets
Last active April 18, 2024 04:12
Highly effective debugging snippet.
{
"CLOG THE LOG": {
"scope": "javascript,typescript,javascriptreact,typescriptreact",
"prefix": "clog",
"body": [
"console.log('$1', $1)"
],
"description": "Splits your cursor into two horcruxes allowing you to clog your log with variables more efficiently."
}
}
@rodricels
rodricels / .tmux.conf
Last active April 18, 2024 04:11
tmux configuration, mouse copy & paste added
# My tmux configuration, partly based on https://github.com/wbkang/wbk-stow/blob/master/tmux-config/.tmux.conf
# Scroll History
set -g history-limit 50000
# show messages for 4 seconds instead
set -g display-time 4000
# set first window to index 1 (not 0) to map more to the keyboard layout
set-option -g renumber-windows on
@cloudwu
cloudwu / rainwater.c
Last active April 18, 2024 04:07
Trapping rain water
#include <stdio.h>
static void
minmax(int height[], int n, int *min, int *max) {
int i;
*min = *max = height[0];
for (i=1;i<n;i++) {
if (height[i] < *min)
*min = height[i];
else if (height[i] > *max)
@tp
tp / line-segment-intersection.ts
Last active April 18, 2024 04:04
Line Segment Intersection
// based on: https://stackoverflow.com/questions/563198/how-do-you-detect-where-two-line-segments-intersect
import test from 'ava';
export interface Point2D {
readonly x: number;
readonly y: number;
}
export class LineSegment {
@gordonmurray
gordonmurray / convertCaddyCerts.md
Last active April 18, 2024 04:02
Steps to convert certificates generated by Caddy Server to certificates that Nginx can use

Convert Caddy Server certificates to LetsEncrypt certificates to be used by Nginx

Caddy

When using Caddy Server, it stores certificates in ~/.caddy/acme/acme-v01.api.letsencrypt.org/sites/{your domain name}/

3 files are stored in the folder called:

  • {yourdomain}.crt
  • {yourdomain}.json
  • {yourdomain}.key
@rokups
rokups / CMakeLists.txt
Last active April 18, 2024 04:01
Dear ImGui CMake build script.
#
# CMake build system for Dear ImGui
# =================================
#
# Build instructions:
# 1. Install latest CMake
# * Windows: https://cmake.org/download/ (Tick checkbox to place cmake in system PATH)
# * Linux: from your favorite package manager
# * MacOS: brew install cmake
# 2. Open command prompt in directory containing "imgui" and "imgui_dev" folders
@dogrocker
dogrocker / Wireless Penetration Testing Cheat Sheet.md
Created July 2, 2016 18:30
Wireless Penetration Testing Cheat Sheet

#Wireless Penetration Testing Cheat Sheet

##WIRELESS ANTENNA

  • Open the Monitor Mode
root@uceka:~# ifconfig wlan0mon down
root@uceka:~# iwconfig wlan0mon mode monitor
root@uceka:~# ifconfig wlan0mon up
@bertocq
bertocq / atajosEclipse.textile
Last active April 18, 2024 03:57
Atajos de teclado para Eclipse

Atajos de teclado para Eclipse (y derivados como ZendStudio)

Para editar un comando: Window → Preferences → General → Keys

Edición

Ctrl+D elimina la línea actual (en la que se encuentra el cursor)
Ctrl+Shift+F formatear código (tabulaciones, saltos de línea,…)

I've recently joined Amazon Dublin from India and got opportunities to interview with Meta London, Zalando Berlin & some other companies. I extensively researched about companies hiring internationally which support visa & relocation for Tech roles. So sharing list of companies:

Do consider to STAR, if it helped you.

London