Skip to content

Instantly share code, notes, and snippets.

View Aareon's full-sized avatar
💭
Looking for work!

Aareon Sullivan Aareon

💭
Looking for work!
  • Amazon Ops Tech IT
  • Mississippi
  • 22:19 (UTC -06:00)
View GitHub Profile
import urllib2, json, re
from util.parse import parse_json
api_url = "http://corgex.corgicoin.co.uk/api_fetch.php?method="
def api_info():
response = urllib2.urlopen(api_url+"getinfo")
page = response.read()
getinfo = json.loads(page)
if getinfo["status"] == 1:
@Aareon
Aareon / price.py
Last active June 27, 2017 20:33
Edit to fit your needs. Try it out in terminal.
import re, json, requests
#{"corg_btc":{"high":0.00000005,"low":0.00000004,"avg":0.00000004,"vol":0.19683907,"vol_cur":4631628.7412026,
#"last":0.00000004,"buy":0.00000004,"sell":0.00000005,"updated":1459641516}}
def price():
coin = "corg"
response = requests.get('https://yobit.net/api/3/ticker/'+coin+'_btc')
page = response.text
getinfo = json.loads(page)
ticker = getinfo['corg_btc']
@Aareon
Aareon / download-icons.py
Last active January 10, 2017 09:03
Downloads Endless Frontier Discord Server icons, displays progress, saves them to ./icons
import os,requests
icons = requests.get('http://pastebin.com/raw/b5fdkNp9').content.splitlines()
if not os.path.exists('./icons'):
print("Creating ./icons")
os.mkdir('./icons')
for i, icon in enumerate(icons):
##print('{0}\r'.format("Downloaded: "+str(i+1)+"/"+str(len(icons))+" images")), ##Python 2.7
##print("Downloaded: "+str(i+1)+"/"+str(len(icons))+" images", end="\r"), ##Python 3.x
img_data = requests.get(icons[i]).content
with open("./icons/icon"+str(i)+".png", 'wb') as handler:
import json
import subprocess
import asyncio
import aiohttp
import os
from os.path import expanduser
home = expanduser("~")
def url2filename(url):
from PIL import Image
from colormath.color_objects import sRGBColor, LabColor
from colormath.color_conversions import convert_color
from colormath.color_diff import delta_e_cie2000
import numpy as np
import re
def rgb2hex(red, green, blue):
"""Return color as #rrggbb for the given color values."""
import sqlite3, keys
def get_debit_mempool():
"""Get the debit mempool from the mempool database and return the
result given that the result is not None. Otherwise, return 0"""
mempool = sqlite3.connect('mempool.db')
mempool.text_factory = str
mempool_cursor = mempool.cursor()
mempool_cursor.execute("SELECT sum(amount) FROM transactions WHERE address = ?;", (address,))
debit_mempool = m.fetchone()[0]
import sqlite3, hashlib
def bin_convert(string):
return ''.join(format(ord(x), '8b').replace(' ', '0') for x in string)
def write_diff_to_log(result, diff_result):
with open("difficulty.log", "w") as f:
f.write("{} {}\n".format(result[0], diff_result))
def get_transaction():
import sqlite3
def get_block():
conn = sqlite3.connect("static/ledger.db") # open to select the last tx to create a new hash from
conn.text_factory = str
c = conn.cursor()
c.execute("SELECT timestamp,block_height FROM transactions WHERE reward = 10 and block_height >= 20000")
return c.fetchall()
if __name__ == "__main__":

CONFIG General Config Manual

Synopsis

The config is used to pre-define values that DOT will utilize after execution. You may define these values from within the config file, via command-line arguments, or via cog. It is recommended to define values from within the config file, and in-fact, it is enforced for many options without modifying the source to bypass this restriction.

Example Config

{
    "bot": {
 "token": "Your Token Here",
import os
import sys
import imagehash
from PIL import Image, ImageDraw
import pygame
pygame.init()
class Tiler:
def __init__(self, imageName, tile_size):