Skip to content

Instantly share code, notes, and snippets.

View ShabbirHasan1's full-sized avatar
:octocat:
Building Things

Shabbir Hasan ShabbirHasan1

:octocat:
Building Things
  • India
View GitHub Profile
@ShabbirHasan1
ShabbirHasan1 / iex.py
Created July 26, 2020 23:34 — forked from zduey/iex.py
Simple Real-Time Stock Streaming with Bokeh
import io
import requests
import pandas as pd
from bokeh.models import ColumnDataSource, HoverTool, ResizeTool, SaveTool
from bokeh.models.widgets import TextInput, Button
from bokeh.plotting import figure, curdoc
from bokeh.layouts import row, widgetbox
TICKER = ""
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
@ShabbirHasan1
ShabbirHasan1 / youtube_formats.md
Created October 20, 2020 13:34 — forked from AgentOak/youtube_formats.md
Youtube Format IDs

Last updated: August 2020

Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22). Depending on the age and/or popularity of the video, not all formats will be available.

DASH video

Resolution AV1 HFR AV1 VP9.2 HDR HFR VP9 HFR VP9 H.264 HFR H.264
4320p 402, 571 272 (138)
@ShabbirHasan1
ShabbirHasan1 / app.py
Created April 13, 2021 06:46 — forked from ajinasokan/app.py
KiteConnect postback example
'''
Hi traders,
Here is a simple generic example for implementing a postback mechanism. You can host this in a remote server or in your local server itself.
Run Locally
===========
1. Install ngrok from https://ngrok.com/
@ShabbirHasan1
ShabbirHasan1 / asynchronous_example.py
Created April 13, 2021 07:24 — 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:
@ShabbirHasan1
ShabbirHasan1 / bns.js
Created April 21, 2021 07:59 — 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
@ShabbirHasan1
ShabbirHasan1 / git-deployment.md
Created May 28, 2021 06:52 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

// Code from: http://patshaughnessy.net/2020/1/20/downloading-100000-files-using-async-rust
//
// Cargo.toml:
// [dependencies]
// tokio = { version = "0.2", features = ["full"] }
// reqwest = { version = "0.10", features = ["json"] }
// futures = "0.3"
use std::io::prelude::*;
use std::fs::File;
@ShabbirHasan1
ShabbirHasan1 / lihkg-show-user-info.user.js
Created August 5, 2021 06:31
LIHKG - Show user information (e.g. user ID, registration time)
// ==UserScript==
// @name LIHKG Show User Info
// @namespace https://gist.github.com/kitce
// @version 0.14
// @description Show the user information (e.g. user ID, registration date) in each reply
// @author kitce
// @include https://lihkg.com/*
// @grant none
// @run-at document-end
// ==/UserScript==
@ShabbirHasan1
ShabbirHasan1 / asyncio_loops.py
Created August 9, 2021 17:59 — 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()