This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ue | |
err() { echo 1>&2 "$*"; } | |
die() { err "ERROR: $*"; exit 1; } | |
mustBool() { | |
[[ "${1#*=}" = "true" || "${1#*=}" = "false" ]] || | |
die "bad boolean property value: $1" | |
} | |
mustInt() { | |
[[ "${1#*=}" =~ [0-9]+ ]] || |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Expects a config file containing the app data from https://my.telegram.org/apps | |
to be saved at ``'~/.telegram/conf.yaml'`` | |
```yaml | |
cgrab: | |
id: <yourId> | |
hash: <yourHash> | |
servers: | |
test: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import numpy as np | |
import re | |
import unicodedata | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.common.exceptions import NoSuchElementException | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This code is adapted from one of Vitalik's earliest implementations of Ethereum, | |
written in python surprisingly. It helps demonstrate the process behind ECDSA | |
""" | |
import numpy as np | |
import hashlib, hmac | |
import sys | |
if sys.version[0] == '2': | |
safe_ord = ord | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numba as nb | |
import numpy as np | |
def impact_perm(nu, gamma, beta): | |
"""Returns the permenant dollar price impact per unit time | |
In paper as :math:`g(\nu)` | |
Args: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2014 Atif Aziz. All rights reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
NewerOlder