Skip to content

Instantly share code, notes, and snippets.

@h4c5
h4c5 / numpy_json_encoder.py
Last active August 4, 2025 08:02
[python] numpy JSON serialization
"""
EDIT : Consider using orjson (https://github.com/ijl/orjson) instead
"""
import json
import numpy as np
class NumpyJSONEncoder(json.JSONEncoder):
"""JSONEncoder to store python dict or list containing numpy arrays"""
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Hakim Cheikh",
"label": "Data Scientist",
"image": "https://avatars.githubusercontent.com/u/25796776?v=4",
"email": "hakimcheikh@yahoo.fr",
"phone": "06 27 29 46 91",
"url": "https://github.com/h4c5",
"summary": "Ingénieur en informatique et sciences des données, je suis passionné par la programmation et l'intelligence artificielle. \nJ'accompagne les entreprise dans leurs projets de machine learning, en intervenant dans toutes les étapes du cycle de vie des produits : de la conception au déploiement en production des modèles.\n\nAu cours de mes 7 années d'expérience en tant que Data Scientist, j'ai eu la chance d'intervenir sur des projets aux thématiques variés : traitement du langage naturel, détection de fraudes, modélisation d'affluence ou encore médecine prédictive.\n\nSi vous cherchez un partenaire pour votre prochain projet d'intelligence artificiel, je ser
@h4c5
h4c5 / get_file_dir.py
Last active August 4, 2025 07:54
[python] current_dir
# Cf. https://stackoverflow.com/questions/2632199/how-do-i-get-the-path-of-the-current-executed-file-in-python/33531619#33531619
from inspect import getsourcefile
from pathlib import Path
CURRENT_DIR = Path(file).parent if (file := getsourcefile(lambda: 0)) else Path.cwd()
@h4c5
h4c5 / download.py
Created August 5, 2025 13:27
[Gitlab] Télécharger tous les snippets
import os
from pathlib import Path
from urllib.parse import quote
import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
TOKEN = "glpat-xxxxxxxxxxxxxxxx-xxx"