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
<!DOCTYPE html> | |
<html> | |
<style> | |
/* By making the light/dark buttons 30px squares, | |
they will not need text labels, | |
but they'll still be large enough to easily click. */ | |
.light-dark-button { | |
border-style: solid; | |
border-color: blue; |
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
library(ggplot2) | |
library(reshape2) | |
library(dplyr) | |
# First, we need to get the data from the World Bank website. | |
# I am using the "weight mean of tariffs applied on manufactored | |
# products". The .csv file is below, but here is the url... | |
# https://data.worldbank.org/indicator/TM.TAX.MANF.WM.AR.ZS | |
wbt <- read.csv(file = 'C://your//file//path//wb_tariff.csv', header = T, stringsAsFactors = F) |
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 requests | |
import uuid | |
import time | |
import json | |
from random import * | |
import hmac | |
import hashlib | |
import urllib3 | |
import urllib.parse | |
from urllib.parse import urlparse |
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 math | |
def vizOr(): | |
''' | |
The buy orders are shown as a plus (+) sign, | |
the sell orders are shown as a minus (-) sign. | |
Obviously, you would want to provide a live | |
market price and list of your orders to the | |
function. | |
''' |
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 time | |
from datetime import datetime | |
# It took me a while to figure out to convert | |
# a string timestamp to the number of seconds | |
# since the Unix epoch. Turns out it is pretty | |
# simple. | |
# Note: it only works for years >= 1900 | |
my_td_string = 'Date: 2018-01-19 Time: 06:35:30.123' |
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 requests | |
import json | |
from requests.auth import AuthBase | |
from requests_oauthlib import OAuth1 | |
from requests_oauthlib import OAuth1Session | |
# This is very simple code to start a simple Twitter bot. | |
# At the moment, this is only for posting tweets to your | |
# page. Twitter offers additional actions (Liking, Replying, | |
# Retweeting, etc) on their (confusing) developer website. |