Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
1. Always use objects when using binding in angular directives. | |
2. Everything is camel case, dashes don't exist in link function. | |
3. Add headers: headers: {'Content-Type': 'application/x-www-form-urlencoded'} when trying to submit form data with $http | |
4. $scope is not a model!!! | |
# coding: utf-8 | |
try: | |
import cPickle as pickle | |
except ImportError: | |
import pickle | |
try: | |
import hashlib | |
sha1 = hashlib.sha1 |
import hmac | |
import time | |
from hashlib import sha256 | |
import subprocess | |
import requests | |
secret_key = '<your secret key here>' or input('Enter your secret key: ') | |
public_key = '<your public key here>' or input('Enter your public key: ') |
def create_signature(): | |
ts = str(int(time.time())) | |
sig = str(ts + "." + public_key).encode() | |
sign = hmac.new(secret_key.encode(), sig, digestmod=sha256).hexdigest() | |
signature = "{0}.{1}.{2}".format(ts, public_key, sign) | |
return signature |
def main(exchange, starting_price, amount, currency, limit_type, limit): | |
""" | |
:param exchange: The exchange where bitcoin was bought | |
:param starting_price: The price at which bitcoin was bought | |
:param amount: The amount of bitcoin | |
:param currency: The currency bitcoin was bought in | |
:param limit_type: The type of threshold, percent or amount | |
:param limit: The value of the threshold | |
:return: Current profit made | |
""" |
{ | |
"name": "bitstamp", | |
"display_name": "Bitstamp", | |
"url": "https://bitstamp.net/", | |
"timestamp": 1493816831, | |
"data_source": "api", | |
"symbols": { | |
"XRPEUR": { | |
"last": 0.0513, | |
"volume": 5706005.4795, |
def calc_percent_diff(now, base): | |
difference = now - base | |
return difference * 100 / base | |
def calculate_profits(cc, latest_bid, starting_price, amount, limit_type, limit): | |
difference = abs((latest_bid - starting_price) * amount) | |
single_diff = latest_bid - starting_price | |
if limit_type == 'percent': | |
percent_difference = calc_percent_diff(latest_bid, starting_price) | |
if percent_difference >= limit: |