Skip to content

Instantly share code, notes, and snippets.

@JoshCheek
JoshCheek / iterm2_inline_images.fish
Last active February 25, 2018 05:50
iTerm2 version 3 beta has an option to pass image data in an escape sequence
# this works in Fish, prob works in Bash too, I didn't try it
# you'll probably need to install the chunky_png gem: `gem install chunky_png`
# docs: http://iterm2.com/documentation-images.html
# video: https://vimeo.com/170123782
ruby -r chunky_png -r base64 -e '
radius = 100
num_points = 200
magnitude_delta = 0.1
white = ChunkyPNG::Color.rgb 0xFF, 0xFF, 0xFF
@RichardBronosky
RichardBronosky / README.MD
Last active July 10, 2025 03:02
cb - A leak-proof tee to the clipboard - Unify the copy and paste commands into one intelligent chainable command.

cb

A leak-proof tee to the clipboard

This script is modeled after tee (see [man tee][2]) and works on Linux, macOS, Cygwin, WSL/WSL2

It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable.

This project started as an answer to the StackOverflow question: [How can I copy the output of a command directly into my clipboard?][3]

@simonw
simonw / recover_source_code.md
Last active September 28, 2024 08:10
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@max-mapper
max-mapper / bibtex.png
Last active November 6, 2024 09:03
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@VojtechKlos
VojtechKlos / split_silence.sh
Created October 12, 2017 14:10
Guide to split audio recording by silence with SoX and ffmpeg
# First denoise audio
## Get noise sample
ffmpeg -i input.ogg -vn -ss 00:00:00 -t 00:00:01 noise-sample.wav
## Create noise profile
sox noise-sample.wav -n noiseprof noise.prof
## Clean audio from noise
sox input.ogg clean.wav noisered noise.prof 0.21
@BrainBacon
BrainBacon / install.sh
Last active December 13, 2017 00:05
Termux-Ubuntu-i386
#!/data/data/com.termux/files/usr/bin/bash
# input validator and help
# DOCKERIMAGE=https://dl.project.org/pub/fedora/linux/releases/26/Docker/x86_64/images/Fedora-Docker-Base-26-1.5.x86_64.tar.xz
DOCKERIMAGE=https://partner-images.canonical.com/core/xenial/current/ubuntu-xenial-core-cloudimg-i386-root.tar.gz
# install necessary packages
apt update && apt install proot tar -y
@miguelmota
miguelmota / process_names.txt
Last active August 13, 2024 09:58
macOS process whitelist
# not an exhaustive list
nsurlsessiond "icloud sync"
fseventsd "macos file system events"
WindowServer "macos windows"
DisplayLinkManager "macos driver"
configd "macos dynamic configuration"
displaypolicyd "macos process"
CommCenter "macos keychain"
kernel_task "macos kernel"
@rjhansen
rjhansen / keyservers.md
Last active July 15, 2025 17:29
SKS Keyserver Network Under Attack

SKS Keyserver Network Under Attack

This work is released under a Creative Commons Attribution-NoDerivatives 4.0 International License.

Terminological Note

"OpenPGP" refers to the OpenPGP protocol, in much the same way that HTML refers to the protocol that specifies how to write a web page. "GnuPG", "SequoiaPGP", "OpenPGP.js", and others are implementations of the OpenPGP protocol in the same way that Mozilla Firefox, Google Chromium, and Microsoft Edge refer to software packages that process HTML data.

Who am I?

@HanSooloo
HanSooloo / TrueTone.scpt
Created April 8, 2020 23:29
AppleScript to change TrueTone
tell application "System Events"
if (get name of every application process) contains "System Preferences" then
set _isSysPrefRunning to true
else
set _isSysPrefRunning to false
end if
end tell
log _isSysPrefRunning
use sys : application "System Events"
@ogrisel
ogrisel / bench_blas_lapack.py
Created January 31, 2021 23:28
Running some benchmark of BLAS level 3 and LAPACK on Apple M1
import numpy as np
try:
import tensorflow as tf
except ImportError:
tf = None
from time import perf_counter
def timeit(func, *args, **kwargs):
durations = []