Skip to content

Instantly share code, notes, and snippets.

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

Fei Qi jazzqi

🏠
Working from home
View GitHub Profile
## USD 格式 特色
@anilpai
anilpai / currency_arbitrage.py
Created September 18, 2019 06:33
Currency Arbitrage using Bellman Ford Algorithm
from typing import Tuple, List
from math import log
rates = [
[1, 0.23, 0.25, 16.43, 18.21, 4.94],
[4.34, 1, 1.11, 71.40, 79.09, 21.44],
[3.93, 0.90, 1, 64.52, 71.48, 19.37],
[0.061, 0.014, 0.015, 1, 1.11, 0.30],
[0.055, 0.013, 0.014, 0.90, 1, 0.27],
[0.20, 0.047, 0.052, 3.33, 3.69, 1],
@raulcontrerasrubio
raulcontrerasrubio / irswap.js
Created August 19, 2019 19:47
Interest Rate Swap Arbitrage
/*
* Returns an array with the new interest rate when two companies (A and B) swap their interest rate on an arbitrage operation.
* [New cost for company A, new cost for company B]
* fixedA<number>: The fixed interest rate of a loan for the company A.
* variableA<number>: The variable interest rate of a loan for the company A.
* fixedB<number>: The fixed interest rate of a loan for the company B.
* variableB<number>: The variable interest rate of a loan for the company B.
* winA<number>: Part (between 0 and 1) of the arbitrage benefits company A will get.
* winB<number>: Part (between 0 and 1) of the arbitrage benefits company B will get.
* aIsFixed<boolean>: If true, the initial interest rate of A is fixed and the new interest rate is variable and viceversa.

Everything I Know About UI Routing

Definitions

  1. Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
    1. pathname - The "file/directory" portion of the URL, like invoices/123
    2. search - The stuff after ? in a URL like /assignments?showGrades=1.
    3. query - A parsed version of search, usually an object but not a standard browser feature.
    4. hash - The # portion of the URL. This is not available to servers in request.url so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things.
    5. state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
@bradtraversy
bradtraversy / docker-help.md
Last active May 26, 2024 10:33
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@bradtraversy
bradtraversy / webdev_online_resources.md
Last active May 22, 2024 06:03
Online Resources For Web Developers (No Downloading)
@bradtraversy
bradtraversy / myscript.sh
Last active May 26, 2024 20:35
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@bradtraversy
bradtraversy / sample.md
Created March 23, 2018 18:17
Markdown Cheat Sheet

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

This text is italic

@nailuoGG
nailuoGG / CRUD.md
Last active August 17, 2019 08:36
[mongodb 文档集合] #mongodb #database
@kukushi
kukushi / Triangular-Arbitrage.py
Last active July 28, 2021 15:11
Binance Triangular Arbitrage
import requests
import datetime
import operator
host = 'https://api.binance.com'
priceURL = host + '/api/v3/ticker/price'
priceResponse = requests.get(priceURL)
priceResponseJSON = priceResponse.json()
# {'symbol': 'ETHBTC', 'price': '0.07608700'}: 1 ETH = 0.0760 BTC