Skip to content

Instantly share code, notes, and snippets.

@ldez
ldez / gmail-github-filters.md
Last active March 5, 2025 17:15
Gmail and GitHub - Filters

Gmail and GitHub

How to filter emails from GitHub in Gmail and flag them with labels.

The labels in this document are just examples.

Pull Request

Filter Label
#!/usr/bin/env python3
'''
always getting the most recent frame of a camera
================================================
Usage:
------
freshest_camera_frame.py
@dvf
dvf / change-codec.md
Last active March 5, 2025 17:15
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

@jrade
jrade / FastExp.h
Last active March 5, 2025 17:14
Fast approximate exponential function
// Copyright 2021 Johan Rade ([email protected])
// Distributed under the MIT license (https://opensource.org/licenses/MIT)
#ifndef FAST_EXP_H
#define FAST_EXP_H
#include <cstdint>
#include <cstring>
@mskelton
mskelton / set-package-manager.sh
Created August 29, 2023 02:08
Set the packageManager key in package.json to the latest version of the given package manager
#!/usr/bin/env bash
# Ensure there is a manifest file
if [[ ! -f package.json ]]; then
echo "error: no manifest file found"
exit 1
fi
# Get the repo name for the given package manager
if [[ $1 == 'npm' ]]; then
@digitaljhelms
digitaljhelms / gist:3099010
Created July 12, 2012 15:58
Squash the first two commits in a git repository's history

The scenario

Your repository has two commits:

$ git log --oneline
957fbfb No, I am your father.
9bb71ff A long time ago in a galaxy far, far away....
@RubenKelevra
RubenKelevra / fast_firefox.md
Last active March 5, 2025 17:09
Make Firefox fast again
@wallyhall
wallyhall / apache_airflow_sso_howto.md
Last active March 5, 2025 17:09
Apache Airflow Azure AAD SSO howto

The following instructions for enabling Azure SSO for Apache Airflow nearly take you all the way - but fall short a couple of details around the configuration of airflow itself:

https://objectpartners.com/2021/12/24/enterprise-auth-for-airflow-azure-ad

All the "Azure" instructions there can be safely followed - the resulting webserver_config.py (which can be injected into a dockerised Airflow in /opt/airflow/webserver_config.py) can be built from the following:

from __future__ import annotations

import os
n = int(input())
for number in range(10 ** n - 1, 10 ** (n - 1) - 1, -2):
print(number)