Skip to content

Instantly share code, notes, and snippets.

View mrauer's full-sized avatar

Maxime Rauer mrauer

  • MidAgent, LLC
  • Austin, TX
View GitHub Profile
@mrauer
mrauer / id-photos.md
Created November 11, 2025 22:10
How to Print ID Photos for Less Than $1
@mrauer
mrauer / github_pr_activity_analyzer.py
Last active January 5, 2025 23:12
Users and Their Merged PRs in the Last 3 Months for a GitHub Organization
import requests
from datetime import datetime, timedelta
from collections import Counter
# Configuration
GITHUB_TOKEN = "ghp_***" # Replace with your GitHub token
ORG_NAME = "ORG" # Replace with your organization name
BASE_URL = "https://api.github.com"
HEADERS = {"Authorization": f"Bearer {GITHUB_TOKEN}"}
START_DATE = (datetime.utcnow() - timedelta(days=90)).isoformat() + "Z" # GitHub API expects ISO8601 format
@mrauer
mrauer / audio-edge.sh
Last active September 19, 2024 17:32
audio-edge.sh
#!/bin/bash
# URL of the stream
STREAM_URL="https://audio-edge-es6pf.mia.g.radiomast.io/a0f4514e-9045-4114-a4cf-17eb3246785a"
# Directory to save the chunks
OUTPUT_DIR="/tmp"
# Base name for the output files
BASE_NAME="bkk.fm"
@mrauer
mrauer / diagflag.py
Created December 2, 2023 07:38
How to Create a Diagonal Tricolor Flag That Would Fit All Screens
# Install Pillow, an image processing library
# pip install pillow
from PIL import Image, ImageDraw
def create_diagonal_sk_flag(size, top_band_color, bottom_band_color):
# Create a blank white image
img = Image.new("RGB", (size, size), (252, 252, 252))
draw = ImageDraw.Draw(img)
@mrauer
mrauer / try-this-github-hack.md
Created August 13, 2023 08:16
try-this-github-hack.md

Try this GitHub Hack

I came across this quite randomly while experimenting with the headers of my browser. However, I wanted to share it with others because it's a useful hack.

If you visit any GitHub project, for example: https://github.com/duckduckgo/content-scope-scripts, it will be rendered in HTML. Now, if you add the header accept: application/json, the output will be fully in JSON.

Seems obvious? But it could be quite useful if you're into web scraping.

Try it:

@mrauer
mrauer / infinite-dockerfile.md
Created July 6, 2023 10:52
Keeping a Docker Container Running Infinitely with Dockerfile

To keep a container running indefinitely using a Dockerfile, you need to specify the appropriate command or entrypoint that will keep the container alive. Here's an example of how you can achieve this:

  1. Create a Dockerfile:
FROM <base_image>

# Add your application code or configuration files, if any

# Specify the command or entrypoint to keep the container running
CMD ["tail", "-f", "/dev/null"]
@mrauer
mrauer / select-random-files-in-a-directory-on-mac.md
Created February 28, 2023 13:58
Select Random Files in a Directory on Mac

Let's suppose you are facing the following use case:

Randomly copy 100 photos out of thousands in a directory, and you are on a mac.

Here is the command to achieve that:

pwd | xargs -I % find % -type f | sort -R | head -n NUMBER_OF_RANDOM_FILES | xargs -I % echo "%" | xargs -I{} cp "{}" YOUR_DESTINATION_PATH

Run this command in the source directory, and replace NUMBER_OF_RANDOM_FILES (ex: 5) and YOUR_DESTINATION_PATH (ex: ~/Desktop/).

@mrauer
mrauer / how-to-hide-wikipedia-on-the-google-search-results.md
Last active February 5, 2023 03:48
How to Hide Wikipedia on the Google Search Results

Are you tired on seeing Wikipedia on the top of all your search results?

Here is a small guide to help you hiding it for goods:

Supposing you are using Chrome or Brave, (1) first install the extension named Tampermonkey. Tampermonkey is used to run so-called userscripts on websites. Userscripts are small computer programs that change the layout of a page, add or remove new functionality and content, or automate actions.

Then (2) install the userscript named Google Hit Hider by Domain (Search Filter / Block Sites) by Jefferson "jscher2000" Scher.

Finally (3) go to any Google Search page, click on the extension, and in Manage Hiding, add wikipedia.org to the list of blocked websites.

@mrauer
mrauer / clean-osx
Created May 19, 2021 01:18
How to Clean Update Files on Mac
This is a process to recover the space taken by updates files on your OSX device:
1. Reboot your machine and keep ⌘ + R pressed.
2. This will start the Recovery system.
3. Open a terminal in there and type "csrutil disable"
4. Restart your machine.
5. Your can now delete any files in `~/Library/Updates` and you'll most likely get several GB of space back.
@mrauer
mrauer / main.go
Last active January 17, 2021 17:50
Access HTTP response as string in Go
package main
import (
"io/ioutil"
"log"
"net/http"
"fmt"
)
func main() {