Skip to content

Instantly share code, notes, and snippets.

View dooee's full-sized avatar
🏠
Working from home

Dooee dooee

🏠
Working from home
View GitHub Profile
import Web3 from "web3";
import { abi as IUniswapV2Pair } from "@uniswap/v2-core/build/IUniswapV2Pair.json";
import { BigNumber } from "bignumber.js";
import { ChainId, Token, WETH, Fetcher, Route } from "@uniswap/sdk";
// Create a new Web3 Instance
const web3 = new Web3(window.ethereum);
// Replace the addresses to point to your Farming Contract
// and LP Token Contract on the desired network
@halfelf
halfelf / how_to_build_a_fast_limit_order_book.md
Created February 11, 2019 02:18
How to Build a Fast Limit Order Book

https://web.archive.org/web/20110219163448/http://howtohft.wordpress.com/2011/02/15/how-to-build-a-fast-limit-order-book/

The response to my first few posts has been much larger than I’d imagined and I’d like to thank everyone for the encouragement.

If you’re interested in building a trading system I recommend first reading my previous post on general ideas to keep in mind.

My first really technical post will be on how to build a limit order book, probably the single most important component of a trading system. Because the data structure chosen to represent the limit order book will be the primary source of market information for trading models, it is important to make it both absolutely correct and extremely fast.

To give some idea of the data volumes, the Nasdaq TotalView ITCH feed, which is every event in every instrument traded on the Nasdaq, can have data rates of 20+ gigabytes/day with spikes of 3 megabytes/second or more. The individual messages average about 20 bytes each so this means handling

//author @TraderX0
//script to plot daily Open high and low
//version 1.1
//last edited 22/11/2018
//title
study(title="TraderX0__O_H_L", shorttitle="TraderX0_O_H_L", overlay=true)
// holds the daily price levels
openPrice = security(tickerid, 'D', open)
@Astro36
Astro36 / rust-ffi-tutorial.md
Last active May 22, 2023 11:15
Node.js에서 FFI로 Rust를 이용해보자

Node.js에서 FFI로 Rust를 이용해보자

소개

Rust는 성능이 우수한 로우 레벨 프로그래밍 언어 중 하나입니다. 또한, 비용 없는 추상화, 메모리 안정성, 데이터 레이스 없는 스레딩 등등을 지원하며 C++에 비해 문법도 간결합니다. 이러한 장점의 Rust를 Node와 결합시켜 사용한다면, Node의 부족한 성능을 메꿀 수 있습니다. Node에서 Rust에서 작성한 함수를 호출하기 위해서는 FFI(Foreign function interface, 외부 함수 인터페이스)를 사용해야 합니다. 아래는 준비물입니다.

준비물

@matteocrippa
matteocrippa / flutter.md
Last active April 20, 2025 03:41
Flutter Cheatsheet

Flutter

A quick cheatsheet of useful snippet for Flutter

Widget

A widget is the basic type of controller in Flutter Material. There are two type of basic Widget we can extend our classes: StatefulWidget or StatelessWidget.

Stateful

StatefulWidget are all the widget that interally have a dynamic value that can change during usage. It can receive an input value in the constructor or reference to functions. You need to create two classes like:

/*jshint esversion: 6 */
const ATR = require('technicalindicators').ATR;
const HA = require('technicalindicators').HeikinAshi;
const moment = require('moment');
const _ = require('underscore-node');
const Log = require('../util/logger');
var calculateSTR = function(result, { multiplier = 3, period = 7, is_ha = true } = {}) {
let open = [],
@CodingDoug
CodingDoug / README.md
Last active August 8, 2025 20:09
Copying Data from a Google Sheet into Firebase Realtime Database in real time via Apps Script
@duhaime
duhaime / batchProcess.scpt
Last active May 27, 2022 02:07
Batch process files with ABBYY FineReader using AppleScript
-- specify input and output directories
set infile_directory to "/Users/doug/Desktop/inputs/"
set outfile_directory to "/Users/doug/Desktop/outputs/"
-- get the basenames of each input file
tell application "System Events"
set infile_list to files of folder infile_directory
end tell
-- process each input file
@ccnokes
ccnokes / axios-instance-config.js
Created July 6, 2017 16:23
Good default configuration for axios in node.js
const axios = require('axios');
const http = require('http');
const https = require('https');
module.exports = axios.create({
//60 sec timeout
timeout: 60000,
//keepAlive pools and reuses TCP connections, so it's faster
httpAgent: new http.Agent({ keepAlive: true }),
@bnb
bnb / convert-to-markdown.js
Created May 5, 2017 16:44
This script converts Google Docs to Markdown files.
/*
Usage:
Adding this script to your doc:
- Tools > Script Manager > New
- Select "Blank Project", then paste this code in and save.
Running the script:
- Tools > Script Manager
- Select "ConvertToMarkdown" function.
- Click Run button.
- Converted doc will be mailed to you. Subject will be "[MARKDOWN_MAKER]...".