Skip to content

Instantly share code, notes, and snippets.

View windows98SE's full-sized avatar
:shipit:
it's good, to be bad.

windows98SE windows98SE

:shipit:
it's good, to be bad.
View GitHub Profile
@windows98SE
windows98SE / settrade.py
Last active September 29, 2020 09:52
THAILAND SETTRADE for scrollphathd
import requests
import time
import scrollphathd
from scrollphathd.fonts import font3x5
class SETTRADE:
def __init__(self):
@windows98SE
windows98SE / Terminal.sublime-settings
Created June 3, 2019 09:03
The command to execute for the terminal
{
// The command to execute for the terminal, leave blank for the OS default
// See https://github.com/wbond/sublime_terminal#examples for examples
"terminal": "C:\\Dropbox\\Win\\Console2\\Console.exe",
// A list of default parameters to pass to the terminal, this can be
// overridden by passing the "parameters" key with a list value to the args
// dict when calling the "open_terminal" or "open_terminal_project_folder"
// commands
"parameters": ["-d", "."],
{'packet_full': '005000060332001a283830373337643865613437346331333137323334323734353166393634313030353536393761623108b3f3c4e60510011a18312d3930303031303530372d362d31353537313634333931', 'packet_header': '00', 'packet_size': 80, 'packet_body': b'\x06\x032\x00\x1a(80737d8ea474c131723427451f96410055697ab1\x08\xb3\xf3\xc4\xe6\x05\x10\x01\x1a\x181-900010507-6-1557164391', 'packet_action': 'SEND', 'rom_protocol_id': 6, 'rom_protocol_type': 3, 'rom_protocol_name': 'SceneItem_pb.ItemUse'}
{'packet_full': '005000060332001a286236613136303961623336653066343136643664363633613537623237346634373764373039653608d4f3c4e60510011a18312d3930303031303530372d362d31353537313634333931', 'packet_header': '00', 'packet_size': 80, 'packet_body': b'\x06\x032\x00\x1a(b6a1609ab36e0f416d6d663a57b274f477d709e6\x08\xd4\xf3\xc4\xe6\x05\x10\x01\x1a\x181-900010507-6-1557164391', 'packet_action': 'SEND', 'rom_protocol_id': 6, 'rom_protocol_type': 3, 'rom_protocol_name': 'SceneItem_pb.ItemUse'}
{'packet_full': '005000060332001a2861613931363635633
@windows98SE
windows98SE / fetch_yahoo_finance.py
Created January 15, 2019 15:59
fetch yahoo finance
#!/usr/bin/env python
import re
import requests
session = requests.Session()
stock = 'T'
start = '1547398800'
end = '1547485200'
@windows98SE
windows98SE / logger.json
Created August 18, 2018 23:45
logging, coloredlogs, logging.config
{
"version": 1,
"disable_existing_loggers": false,
"formatters": {
"console-simple": {
"()": "ext://coloredlogs.ColoredFormatter",
"format": "[%(asctime)s.%(msecs)03d] : %(message)s",
"datefmt": "%H:%M:%S",
"field_styles": {
"asctime": {"color": "green"}
@windows98SE
windows98SE / binance.py
Created April 29, 2018 15:42
binance.py demo
#!/usr/bin/env python3
# -*- encoding : utf-8 -*-
from utility.tools import *
# DOCUMENT : https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md
class BINANCE:
def __init__(self, key='', secret=''):
self._key = key
self._secret = secret
@windows98SE
windows98SE / polo_ws.py
Last active March 19, 2018 23:25
poloniex web socket
#!/usr/bin/env python3
# -*- encoding : utf-8 -*-
import asyncio
import json
import threading
import datetime
import time
from requests import get as __get__
from collections import OrderedDict
@windows98SE
windows98SE / async.py
Created October 14, 2017 21:23 — forked from graffic/async.py
Async demo python 3.5
import aiohttp
import asyncio
async def get(index):
response = await aiohttp.get('http://httpbin.org/delay/%d' % index)
print(index, "Done")
response.close()
async def doMany():
coros = []
from twisted.internet.defer import inlineCallbacks
from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner
import json
def onTick(*args): # everytime we get a push message from the polo ticker
print(json.dumps(args)) # send json string to stdout
class Subscribe2Ticker(ApplicationSession):
@inlineCallbacks
def onJoin(self, details):
import asyncio
import json
import threading
import urllib
import urllib.request
from collections import OrderedDict
import websockets
GET_TICKERS_URL = 'https://poloniex.com/public?command=returnTicker'