Skip to content

Instantly share code, notes, and snippets.

@NZWDDY
NZWDDY / kitetickersample.html
Created December 25, 2022 19:32 — forked from ajinasokan/kitetickersample.html
Kite Ticker Pure JS Example
<script src="ticker.js"></script>
<script>
var ticker = new KiteTicker({api_key: "api_key", access_token: "access_token"});
ticker.connect();
ticker.on("ticks", onTicks);
ticker.on("connect", subscribe);
function onTicks(ticks) {
@NZWDDY
NZWDDY / kitetickersample.html
Created December 23, 2022 19:38 — forked from ShabbirHasan1/kitetickersample.html
Kite Ticker Pure JS Example
<script src="ticker.js"></script>
<script>
var ticker = new KiteTicker({api_key: "api_key", access_token: "access_token"});
ticker.connect();
ticker.on("ticks", onTicks);
ticker.on("connect", subscribe);
function onTicks(ticks) {
@NZWDDY
NZWDDY / asynchronous_example.py
Created December 23, 2022 19:34 — forked from tylerburdsall/asynchronous_example.py
Example showing asynchronous HTTP request with Python 3.5.0 + asyncio
import requests
import asyncio
from concurrent.futures import ThreadPoolExecutor
from timeit import default_timer
START_TIME = default_timer()
def fetch(session, csv):
base_url = "https://people.sc.fsu.edu/~jburkardt/data/csv/"
with session.get(base_url + csv) as response:
@NZWDDY
NZWDDY / bns.js
Created December 23, 2022 19:31 — forked from vishnus/bns.js
Black and Scholes formula in JS
function bns() {
// Sample input
spot = 8400;
strike = 8600;
expiry = "2016-12-01 23:59:00";
volt = 18;
int_rate = 7;
div_yld = 0;
//Validation
@NZWDDY
NZWDDY / asyncio_multithreading_multiprocessing.py
Created December 23, 2022 19:30 — forked from CMCDragonkai/asyncio_multithreading_multiprocessing.py
Python AsyncIO with Multithreading and Multiprocessing #python
import time
import asyncio
import logging
import uvloop
import aiojobs.aiohttp
import sys
from aiohttp import web
import aioprocessing
import concurrent.futures
@NZWDDY
NZWDDY / asyncio_loops.py
Created December 23, 2022 19:27 — forked from lars-tiede/asyncio_loops.py
asyncio + multithreading: one asyncio event loop per thread
import asyncio
import threading
import random
def thr(i):
# we need to create a new loop for the thread, and set it as the 'default'
# loop that will be returned by calls to asyncio.get_event_loop() from this
# thread.
loop = asyncio.new_event_loop()
@NZWDDY
NZWDDY / FastTelethon.py
Created December 23, 2022 18:47 — forked from ShabbirHasan1/FastTelethon.py
This will increase the download/upload speed when using telethon
# copied from https://github.com/tulir/mautrix-telegram/blob/master/mautrix_telegram/util/parallel_file_transfer.py
# Copyright (C) 2021 Tulir Asokan
import asyncio
import hashlib
import inspect
import logging
import math
import os
from collections import defaultdict
from typing import Optional, List, AsyncGenerator, Union, Awaitable, DefaultDict, Tuple, BinaryIO
@NZWDDY
NZWDDY / list.md
Created December 23, 2022 18:41 — forked from ih2502mk/list.md
Quantopian Lectures Saved
# -*- coding: utf-8 -*-
"""
:description: A Function To Generate TOTP From Qrcode Image.
:license: MIT.
:author: Shabbir Hasan
:created: On Wednesday November 18 2022 17:43:57 GMT+05:30
"""
__author__ = "Shabbir Hasan"
__webpage__ = "https://github.com/ShabbirHasan1"
__license__ = "MIT"
# -*- coding: utf-8 -*-
"""
:description: A Function To Generate TOTP From Qrcode Image.
:license: MIT.
:author: Shabbir Hasan
:created: On Wednesday November 18 2022 17:43:57 GMT+05:30
"""
__author__ = "Shabbir Hasan"
__webpage__ = "https://github.com/ShabbirHasan1"
__license__ = "MIT"