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,
@gmjelle
gmjelle / aliExpressApi.js
Last active October 5, 2024 08:53
Making an API call to the AliExpress Affiliate API. Explains how to sign the request and create the correct hash.
import crypto from "crypto";
import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
import timezone from "dayjs/plugin/timezone";
dayjs.extend(utc);
dayjs.extend(timezone);
const API_URL = "http://gw.api.taobao.com/router/rest";
const API_SECRET = "FIND THIS IN THE AE CONSOLE";
@rmalchow
rmalchow / solr_pw_hash.md
Last active August 21, 2023 12:33
how to generate password hash and salt for basic auth in solr

solr has a basic authentication module. the description of how to generate the necessary hash + salt string is very hazy. there is this:

https://github.com/ansgarwiechers/solrpasswordhash

project with java code extracted from the solr source .... and then there is this:

@przbadu
przbadu / react_on_docker2.md
Created October 29, 2020 04:31
Docker configuration to run react app

Setup docker to run React app

After setting up docker to generate React app without installing node js in https://gist.github.com/przbadu/4a62a5fc5f117cda1ed5dc5409bd4ac1 It was confusing to some of the devs, how to run react app, so I am creating this as second step to the configuration.

Generate required files in your react project

cd my-react-app
touch Dockerfile Dockerfile.dev docker-compose.yml .dockerignore
@mathisve
mathisve / insert.go
Last active March 15, 2024 04:28
Golang script to rapidly insert data into a MySQL database
package main
import (
"bufio"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"sync"
// "math/rand"
@ismailyenigul
ismailyenigul / timescaledb-timescaledb-postgresql-adaptor-docker-compose.yml
Last active October 15, 2025 10:08
docker compose for timescaledb and postgresql-adaptor
I choosed host path mapping for postgresql data directory in a separate OS disk to be able to resize partition later.
You can use docker standart volumes too.
# mkdir -p /data/timescaledb
# cat docker-compose.yml
version: '3'
services:
@aditya-malte
aditya-malte / smallberta_pretraining.ipynb
Created February 22, 2020 13:41
smallBERTa_Pretraining.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ErikCH
ErikCH / vue3
Created February 10, 2020 04:15
<div id="app"></div>
<script src="vue.global.js"></script>
<script>
const MyComponent = {
data: {
name: 'Erik'
},
template: `<h1>{{ name }}</h1>`
}
@navono
navono / reconn.go
Created July 23, 2019 07:09
websocket reconnect in golang
package reconWS
import (
"errors"
"math/rand"
"net/http"
"net/url"
"sync"
"time"
@ewancook
ewancook / bellman_ford.go
Last active March 9, 2024 08:14
Arbitrage with Bellman Ford
package bellmanford
import (
"math"
)
// Graph represents a graph consisting of edges and vertices
type Graph struct {
edges []*Edge
vertices []uint