This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"blacklist": "*://pynative.com/*\n*://pythonbasics.org/*\n*://realpython.com/*\n*://thispointer.com/*\n*://www.codecademy.com/*\n*://www.codingem.com/*\n*://www.digitalocean.com/*\n*://www.educative.io/*\n*://www.edureka.co/*\n*://www.freecodecamp.org/*\n*://www.geeksforgeeks.org/*\n*://www.javatpoint.com/*\n*://www.learnbyexample.org/*\n*://www.programiz.com/*\n*://www.pythontutorial.net/*\n*://www.simplilearn.com/*\n*://www.thoughtco.com/*\n*://www.toppr.com/*\n*://www.tutorialspoint.com/*\n*://www.w3resource.com/*\n*://www.w3schools.com/*\n// Highlighting:\n@1*://*.baeldung.com/*\n@1*://*.docs.python.org/*\n@1*://*.stackoverflow.com/*\n*://www.tutorialsteacher.com/*\n*://towardsdatascience.com/*\n*://flexiple.com/*\n*://www.askpython.com/*\n*://pythonprinciples.com/*\n*://appdividend.com/*", | |
"blockWholeSite": false, | |
"skipBlockDialog": true, | |
"hideBlockLinks": false, | |
"hideControl": false, | |
"enablePathDepth": false, | |
"linkColor": "default", | |
"blockColor": "default", | |
"highlightColors": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/3796927/how-do-i-git-clone-a-repo-including-its-submodules/56833308#comment132351771_56833308 | |
git submodule foreach --recursive git clean -xfd | |
git submodule foreach --recursive git reset --hard | |
git submodule update --init --recursive --remote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from requests import Session | |
from time import time | |
from functools import partial | |
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor | |
import requests | |
def fetch(i, fetch_object=requests): | |
return fetch_object.get(f"https://jsonplaceholder.typicode.com/todos/{i}").json()[ | |
"id" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MaxStack { | |
stack = []; | |
checkMaxStack(popped) { | |
if (this.max === popped) | |
this.stack.pop(); | |
} | |
feedMaxStack(values) { | |
const largest = Math.max(...values); | |
if (!this.max) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stackoverflow.com/questions/61411776/is-js-native-array-flat-slow-for-depth-1 | |
// [--jsperf is down--] https://jsperf.com/flat-array-depth-1 - I added this jsperf benchmark after this gist was created and the SO question was asked. | |
let TenThouWideArray = Array(1000).fill().map(el => Array(10).fill(1)); | |
let TenThouNarrowArray = Array(10).fill().map(el => Array(1000).fill(1)); | |
let TenMilWideArray = Array(10000).fill().map(el => Array(1000).fill(1)); | |
let TenMilNarrowArray = Array(100).fill().map(el => Array(100000).fill(1)); | |
let benchmarks = { TenThouWideArray, TenThouNarrowArray, TenMilWideArray, TenMilNarrowArray }; | |
let implementations = [ |