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
"""
Simple Moving Average implemented using KiteConnect Python library. -- [https://kite.trade](kite.trade)
Rainmatter (c) 2016
License
-------
This GIST is licensed under the MIT License
"""
from kiteconnect import KiteConnect
@ShabbirHasan1
ShabbirHasan1 / holotools-fixes.user.js
Created May 11, 2022 15:34 — forked from lbmaian/holotools-fixes.user.js
HoloTools Fixes and Enhancements
// ==UserScript==
// @name HoloTools Fixes and Enhancements
// @namespace https://gist.github.com/lbmaian/fef815da2628dc6e546ba1f7cd8212a5
// @version 0.2
// @description Fixes for HoloTools
// @author lbmaian
// @match https://hololive.jetri.co/
// @icon https://hololive.jetri.co/favicon-fbk.png
// @run-at document-start
// @grant none
@ShabbirHasan1
ShabbirHasan1 / intercept-xhr.js
Created May 11, 2022 15:35
Intercept XHR requests so that we can do something useful with it.
// Taken from https://stackoverflow.com/a/27363569
// Allows for the object to be interrogated
((() => {
const origOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function() {
console.log('request started!');
this.addEventListener('load', function() {
console.log('request completed!');
console.log(this.readyState); //will always be 4 (ajax is completed successfully)
function interceptNetworkRequests(ee) {
const open = XMLHttpRequest.prototype.open;
const send = XMLHttpRequest.prototype.send;
const isRegularXHR = open.toString().indexOf('native code') !== -1;
// don't hijack if already hijacked - this will mess up with frameworks like Angular with zones
// we work if we load first there which we can.
if (isRegularXHR) {
@ShabbirHasan1
ShabbirHasan1 / Tampermonkey-XHR-Intercept.js
Created May 11, 2022 15:37 — forked from fellypsantos/Tampermonkey-XHR-Intercept.js
Script to intercept XMLHttpRequest calls made by some page.
/* Intercept XMLHttpRequests */
(function(open) {
XMLHttpRequest.prototype.open = function() {
this.addEventListener("readystatechange", function() {
console.log("readyState: "+this.readyState);
}, false);
open.apply(this, arguments);
};
})(XMLHttpRequest.prototype.open);
@ShabbirHasan1
ShabbirHasan1 / xhr-intercept.js
Created May 11, 2022 15:40
XMLHttpRequestを仲介するユーザースクリプト (Tampermonkey)
// ==UserScript==
// @name xhr-intercept
// @namespace https://github.com/BiasHacker
// @version 0.1
// @description XMLHttpRequestを仲介します。
// @author Sin
// @match https://hoge.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
@ShabbirHasan1
ShabbirHasan1 / main.rs
Created July 14, 2022 16:28 — forked from lu4nm3/main.rs
Tokio Async: Concurrent vs Parallel
use futures::StreamExt;
use std::error::Error;
use tokio;
use tokio::macros::support::Pin;
use tokio::prelude::*;
use tokio::time::{Duration, Instant};
pub fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut multi_threaded_runtime = tokio::runtime::Builder::new()
.threaded_scheduler()
@ShabbirHasan1
ShabbirHasan1 / download_file.rs
Created July 14, 2022 16:35 — forked from giuliano-macedo/download_file.rs
Download large files in rust with progress bar using reqwest, future_util and indicatif
// you need this in your cargo.toml
// reqwest = { version = "0.11.3", features = ["stream"] }
// futures-util = "0.3.14"
// indicatif = "0.15.0"
use std::cmp::min;
use std::fs::File;
use std::io::Write;
use reqwest::Client;
use indicatif::{ProgressBar, ProgressStyle};
var http = require("http");
http.createServer().listen(8080);
loginAndStartSocket();
async function loginAndStartSocket() {
// XTS Objects from library
const XtsMarketDataAPI = require("xts-marketdata-api").XtsMarketDataAPI;
const XtsMarketDataWS = require("xts-marketdata-api").WS;
// JSON file containing appSecret & appKey
const secrets = require("./secrets/iiflBlaze.json");
@ShabbirHasan1
ShabbirHasan1 / gist:b1edd307421a28c22c6e82669101947a
Created August 12, 2022 21:37 — forked from pwlin/gist:8a0d01e6428b7a96e2eb
Android : add cert to system store
https://code.google.com/p/android/issues/detail?id=32696#c5
If you have a certificate that is not
trusted by Android, when you add it, it goes in the personal cert store.
When you add a cert in this personal cert store, the system requires a
higher security level to unlock the device. But if you manage to add your
cert to the system store then you don't have this requirement. Obviously,
root is required to add a certificate to the system store, but it is quiet
easy.