Skip to content

Instantly share code, notes, and snippets.

View malohtie's full-sized avatar

Mohamed Amine EL ATTABI malohtie

View GitHub Profile
@zapalote
zapalote / extract-gbooks-terms.py
Last active April 2, 2024 11:31
Example of multi-threading and memory mapped file processing.
# extraction pattern: ngram TAB year TAB match_count TAB volume_count NEWLINE
# out: unique_ngram TAB sum(match_count) NEWLINE
import re
import os, sys, mmap
from pathlib import Path
from tqdm import tqdm
from concurrent.futures import ThreadPoolExecutor
abv = re.compile(r'^(([A-Z]\.){1,})(_|[^\w])') # A.B.C.
@FilipBartos
FilipBartos / axios-response-interceptor.js
Last active April 11, 2024 07:03
Axios response interceptor for access token refresh supporting 1 to N async requests
let isAlreadyFetchingAccessToken = false
let subscribers = []
function onAccessTokenFetched(access_token) {
subscribers = subscribers.filter(callback => callback(access_token))
}
function addSubscriber(callback) {
subscribers.push(callback)
}
@odan
odan / xampp_php7_xdebug.md
Last active May 29, 2024 13:56
Installing Xdebug for XAMPP