Skip to content

Instantly share code, notes, and snippets.

@kidpixo
kidpixo / postgresql90.md
Created May 21, 2013 09:56
PostgreSQL 9.0 cheatsheet from www.postgresonline.com
@kidpixo
kidpixo / downgrade-yay.sh
Created March 3, 2026 09:10
archlinux-downgrade/downgrade + yay cache + bash completion + (optional) fzf
# ------------------------------------------------------------------------------
# Function: downgrade-yay
# Description: Wraps 'downgrade' for AUR packages built via yay.
# If no argument is provided, it uses fzf to select from the cache.
# Usage: downgrade-yay <package-name>
# Dependencies: downgrade, fzf (optional for interactive selection)
# ------------------------------------------------------------------------------
downgrade-yay() {
local YAY_DIR="$HOME/.cache/yay"
local TARGET_PKG="$1"
@kidpixo
kidpixo / jupyter_shortcuts.md
Last active February 24, 2026 15:43
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Warning This is SEVERELY outdated, the current jupyter version is > 6.X, please refer to your current jupyter notebook installation!

Disclaimer : I just copied those shortcuts from Jupyter Menú > Help > Keyboard Shortcuts, I didn't wrote them myself.

Check your current shortcuts in your Help, shortcuts coule have been modified by extensions or your past self.

Toc

Keyboard shortcuts

@kidpixo
kidpixo / clipify.sh
Last active February 6, 2026 11:17
bash script to capture shell output to clipboard, optionally the original command and print to stdout too.
clipify() {
local stdout=false
local capture_cmd=false
local OPTIND usage
usage="Usage: command | clipify [OPTIONS]
(Always copies to clipboard)
-a All: Include the command itself in the capture
-s Screen: Also print the final content to terminal (tee)
@kidpixo
kidpixo / separator.sh
Last active January 13, 2026 21:51
A versatile Bash utility for terminal dividers. Features auto-width detection via tput, robust ANSI color support using printf %b, and a built-in help menu. Ideal for organizing long log outputs or CLI tool reports.
# ==============================================================================
# Function: separator
# Description: Prints a repeating line of characters to the terminal.
# Usage: separator [char] [length/color] [color]
# ==============================================================================
separator() {
if [ -z "$1" ]; then
echo "Usage: separator [char] [length/color] [color]"
return 1
fi
@kidpixo
kidpixo / check_arch.py
Last active December 19, 2025 13:58
Health checkups for the sophisticated Arch user: sanity checks for your rolling-release setup written in pure python3 stdlib, no dependencies (hell).
#!/usr/bin/env python3
import subprocess
import os
import sys
import argparse
import shutil
import platform
# --- Configuration & Colors ---
BLUE = '\033[34m'
@kidpixo
kidpixo / conda_update_all_envs.sh
Last active November 10, 2025 08:50
Update all conda enviroment, optionally using another executable like mamba and dry run option setting from cli.
# define CONDACOMMAND externally to overwrite this, I use conda or mamba
# default is to use mamba, a looooot faster
CONDACOMMAND=${1:-'mamba'}
# DRYRUNCONDACOMMAND : is set to anything, just print the commands
if [ -z $DRYRUNCONDACOMMAND ]
then
echo "DRYRUNCONDACOMMAND is unset, this is the real stuff"
DRYRUNCONDACOMMAND=''
else
# from : 10 terminal commands to speed up your Mac | defaults-write.com
# https://www.defaults-write.com/10-terminal-commands-to-speed-up-macos-sierra-on-your-mac/
#1. Disable animations when opening and closing windows.
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
#2. Disable animations when opening a Quick Look window.
defaults write -g QLPanelAnimationDuration -float 0
#3. Accelerated playback when adjusting the window size (Cocoa applications).
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
#4. Disable animation when opening the Info window in Finder (cmd⌘ + i).
defaults write com.apple.finder DisableAllAnimations -bool true
@kidpixo
kidpixo / PostGIS 2.0 Cheatsheet.md
Last active September 2, 2025 09:49
PostGIS 2.0 Cheatsheet
@kidpixo
kidpixo / convert_audio_ffmpeg.py
Last active February 4, 2025 12:35
Python audio compressor using ffmpeg with Opus support for highly efficient speech compression. Supports batch processing, dry runs, and customizable bitrates.
#!/usr/bin/env python
"""
This module provides a command-line tool for compressing audio files using ffmpeg.
It supports various audio formats (Opus, AAC, OGG, MP3), customizable bitrates,
mono/stereo conversion, parallel processing, and dry-run mode. It also handles
input and output directories and provides sensible default settings.
Key features: