Skip to content

Instantly share code, notes, and snippets.

View MtkN1's full-sized avatar

machuken MtkN1

View GitHub Profile
@MtkN1
MtkN1 / index.html
Created April 21, 2022 11:33
WebSocket Test
<html>
<head>
<title>WebSocket Test</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/reconnecting-websocket/1.0.0/reconnecting-websocket.js" integrity="sha512-SxQulwFs2B38bmUJtBSo9tD07MDrtCbY8me3AOZ14tRknCPTeMDLvCQV4ekhs8R0o9QPnW5HQanKfveexVcwLA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
</head>
<body>
<h1>WebSocket Test</h1>
<h2>Open</h2>
<div id="onopen"></div>
@MtkN1
MtkN1 / tmp.SLXhFVB0aw.ipynb
Last active June 17, 2022 05:04
FTXの販売所レート取得
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MtkN1
MtkN1 / tmp.50t2wAqcq3.ipynb
Last active June 17, 2022 05:05
bitbank Socket.IO ライブラリを用いたエンコードとパース
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MtkN1
MtkN1 / spot.ipynb
Last active June 20, 2022 07:45
Coingecko APIでBTC/JPY市場の取引量(USD)を取得するコード
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MtkN1
MtkN1 / bybit_futures_symbol_names.py
Last active June 28, 2022 01:36
Bybit Futures Symbol Names
import http.client
import json
import urllib.request
resp: http.client.HTTPResponse
with urllib.request.urlopen('https://api.bybit.com/v2/public/symbols') as resp:
data = json.loads(resp.read().decode())
print(*filter(lambda x: all([x['name'] != x['alias'], x['status'] == 'Trading']), data['result']), sep='\n\n')
import asyncio
import os
import sys
import aiohttp
from loguru import logger
logger.remove()
logger.add(
sys.stdout,
import asyncio
from typing import List
import pybotters
import streamlit as st
async def watch_event(
store: pybotters.BybitUSDTDataStore, name: str, result: List, event: asyncio.Event
):
@MtkN1
MtkN1 / minkabu_ws.py
Created December 6, 2022 02:59
みんかぶ WebSocket Sample
import socketio
sio = socketio.Client()
usdjpy = {}
@sio.event
def connect():
sio.emit("subscribe", "USDJPY")
@MtkN1
MtkN1 / python
Created January 13, 2023 07:13
Docker Run Aliases
#!/usr/bin/env bash
set -eux
docker run --rm -it \
-u vscode \
-w /home/vscode \
mcr.microsoft.com/devcontainers/python:0-${1:-3.11-bullseye} \
bash
@MtkN1
MtkN1 / querying-symbol-combinations-using-sql.ipynb
Last active February 15, 2023 08:22
Querying symbol combinations using sql
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.