Skip to content

Instantly share code, notes, and snippets.

View Philippe-Cholet's full-sized avatar
🦀
Maintaining rust-itertools

Philippe Cholet Philippe-Cholet

🦀
Maintaining rust-itertools
View GitHub Profile
@Philippe-Cholet
Philippe-Cholet / post-checkout
Last active May 13, 2024 21:19
rust-itertools: my git hooks to avoid most CI failures
#!/bin/sh
# Automatically sync the base branch of the remote fork and fetch it.
fork=Philippe-Cholet/itertools
base_branch=master
branch="$(git rev-parse --abbrev-ref HEAD)"
if [ "$branch" = "$base_branch" ]; then
gh repo sync $fork -b $base_branch
git fetch origin $base_branch
@Philippe-Cholet
Philippe-Cholet / aoc_opening_times.py
Created December 14, 2022 17:16
When did I open an "Advent of Code" puzzle for the first time?!
import re
try:
# pip install browserhistory
# https://github.com/kcp18/browserhistory
import browserhistory as bh
# It explores firefox, chrome and safari.
query_result = [item for history in bh.get_browserhistory().values() for item in history]
except ImportError:
# Or if you are on Windows and use Firefox like me, you do not need to install anything.
import os
@Philippe-Cholet
Philippe-Cholet / wallpaper-changer.pyw
Created August 25, 2020 17:43
My Wallpaper Changer for Windows [controls in systemtray]
import ctypes
from collections import deque
from os import scandir, startfile
from os.path import basename, exists, isdir, splitext
from random import shuffle
from time import time
from typing import Deque, List
# py -m pip install WxPython PySimpleGUIWx
import PySimpleGUIWx as sg
@Philippe-Cholet
Philippe-Cholet / duplicates_cleaner.py
Created August 24, 2020 09:16
Duplicates cleaner, hash files in a thread pool [mix cli-gui]
import hashlib
import os
from collections import defaultdict
from multiprocessing.pool import ThreadPool
from typing import DefaultDict, Iterator, List, Optional, Set, Tuple
import PySimpleGUI as sg
from tqdm import tqdm
if os.name == 'nt':
@Philippe-Cholet
Philippe-Cholet / py_choco_gui.pyw
Created August 24, 2020 09:03
My Chocolatey GUI
import itertools as it
import os
import shutil
import subprocess as sp
from tempfile import NamedTemporaryFile
from time import sleep
from typing import List
import PySimpleGUI as sg
@Philippe-Cholet
Philippe-Cholet / safely_rename.py
Created August 24, 2020 08:58
Safely colored rename customizable
import os
import traceback
import typing # overload
from contextlib import contextmanager
from difflib import SequenceMatcher
from typing import Any, Callable, Collection, Iterator, List, Tuple, Union
import click
__all__ = 'SafelyRename', 'default_files_comparisons'
@Philippe-Cholet
Philippe-Cholet / README.md
Last active June 28, 2019 16:13
Generate pull requests and issues from a lot of github repositories in an asynchronous way

Moved to https://github.com/Philippe-Cholet/github-pulls.

This personal command line tool allow to efficiently go through a lot of github repositories (from given users or given repos in a json file) to find pull requests and issues, and render results in a single webpage with links to them.