This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Update Route53 DNS A name record for home IP. | |
# | |
# Uses the *route53* library, rather than boto. | |
from __future__ import print_function | |
import os | |
import re |
This file contains hidden or 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
# http://stackoverflow.com/questions/12723375/python-line-highlight-on-sublime-text-2-from-ipdb | |
import pdb | |
from PdbSublimeTextSupport import preloop, precmd | |
pdb.Pdb.preloop = preloop | |
pdb.Pdb.precmd = precmd | |
try: | |
from ipdb.__main__ import Pdb as ipdb_Pdb | |
except ImportError: |
This file contains hidden or 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
date | Airbus | Boeing | |
---|---|---|---|
2000-07-31 | 0 | 0 | |
2000-08-31 | -0.884 | 9.8912 | |
2000-09-29 | 9.6685 | 32.1383 | |
2000-10-31 | 32.5967 | 38.9245 | |
2000-11-30 | 33.1492 | 41.4853 | |
2000-12-29 | 30.7182 | 35.2113 | |
2001-01-31 | 27.0718 | 19.8464 | |
2001-02-28 | 24.3094 | 27.4264 | |
2001-03-30 | 16.0773 | 14.1306 |
This file contains hidden or 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 -e | |
show_help() { | |
cat << EOF | |
Usage: ${0##*/} [-u USER] [-p PASS] [-P PORT] [-H HOST] [DATABASE] | |
${0##*/} -h | |
Open a standard connection in Sequel PRO. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 datetime | |
import random | |
import time | |
from multiprocessing import Lock | |
from notion.client import * | |
from notion.block import * | |
mutex = Lock() |
This file contains hidden or 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
def readmail(volume): | |
time.sleep(1.5) | |
m = imaplib.IMAP4_SSL("imap.gmail.com") | |
m.login(user, pwd) | |
m.select('"[Gmail]/All Mail"') | |
resp, items = m.search(None, | |
"NOT SEEN FROM tradingview") | |
items = items[0].split() | |
for emailid in items: | |
resp, data = m.fetch(emailid, |
This file contains hidden or 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
def generate_nonce(length=8): | |
"""Generate pseudorandom number.""" | |
return ''.join([str(random.randint(0, 9)) for i in range(length)]) | |
def trade(signal,volume,pair): | |
try: | |
trade = 'TRADE|OPEN|' + signal + '|' + pair + '|0|0|0|IcarusBot Trade|' + generate_nonce() + '|' + volume | |
s.send_string(trade, encoding='utf-8') | |
print("Waiting for metatrader to respond...") |
This file contains hidden or 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
trs = $($(".paper_trading table.balances")[2]).find(".tv-data-table__tbody tr").map((_, value) => $(value).find("td").map((_, value) => value.innerText)) | |
trades = Object.values(trs.map((_, tr) => [Object.values(tr).slice(0,5)])) | |
var toTimestamp = val => { | |
var parts = val.split(' ') | |
switch(parts[1]) { | |
case "Minutes": | |
var d = new Date(new Date().getTime() - (parts[0] * 60 * 60)) | |
break; | |
case "Hours": |
This file contains hidden or 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
license: mit |
OlderNewer