Skip to content

Instantly share code, notes, and snippets.

@jonathan-beebe
jonathan-beebe / clean_old_code_simulators.sh
Last active February 12, 2019 19:40
Clean out unused Xcode Simulators
# Close Xcode & the iOS Simulator
# http://stackoverflow.com/a/30940055
# Remove any old runtimes from this directory.
cd /Library/Developer/CoreSimulator/Profiles/Runtimes
# e.g.
sudo rm -rf iOS\ 8.1.simruntime
# http://stackoverflow.com/a/11790983
# Remove the download receipts for simulators you don't need anymore.
@endash
endash / gist:acda517225dc9f4bc9db
Last active September 27, 2019 06:10
Photoshop style gradients in Core Graphics via use of CGShader (with thanks to @jernejstrasner, see his explanation of why your gradients might not look how your designers intended http://jernejstrasner.com/2014/01/09/smooth-gradients-ios.html) ⚠️ see comments for notes
func SineEaseInOutLinearAverage(x: Double) -> Double {
var easeInOutSine = ((cos(M_PI * x) - 1) / -2)
return (easeInOutSine + x) / 2
}
func ShadingFunctionCreate(startColor: NSColor, _ endColor: NSColor, _ slopeFunction: (Double) -> Double) -> (UnsafePointer<CGFloat>, UnsafeMutablePointer<CGFloat>) -> Void {
return { inData, outData in
let q = CGFloat(slopeFunction(Double(inData[0])))
outData[0] = startColor.redComponent + (endColor.redComponent - startColor.redComponent) * q
outData[1] = startColor.greenComponent + (endColor.greenComponent - startColor.greenComponent) * q
@bishboria
bishboria / springer-free-maths-books.md
Last active March 24, 2025 13:36
Springer made a bunch of books available for free, these were the direct links
@steve-jansen
steve-jansen / docker-inspect.sh
Created August 19, 2016 01:55
List labels for a docker container
docker inspect -f '{{ range $k, $v := .ContainerConfig.Labels -}}
{{ $k }}={{ $v }}
{{ end -}}' $cid
@tubaman
tubaman / ledgerparser.py
Last active February 27, 2023 16:03
ledgerparser
"""ledger journal parser
We use this to parse the ledger file because we want to preserve the
exact format of the file including spaces, etc. It maps the parsed
transaction to the origin lines of the file.
"""
import ledger
@ldez
ldez / gmail-github-filters.md
Last active April 16, 2025 20:12
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
@99z
99z / 9front_tutorials.md
Last active April 14, 2025 20:00
9front tutorials

9front tutorials

Current as of 9front-5966.df2c352ae695

This is a collection of notes on how to complete tasks I've found myself commonly performing while using 9front.

Note that most of what is here is straight from various parts of the 9front FQA, just ordered differently. If not from the FQA, I'll provide the source under the header for the section.

As I'm in the process of learning Plan 9/9front, feel free to comment with suggestions or corrections.

@samoshkin
samoshkin / toggle_keybindings.tmux.conf
Last active February 2, 2025 07:21
tmux.conf excerpt to toggle on/off session keybindings and prefix handling
bind -T root F12 \
set prefix None \;\
set key-table off \;\
set status-style "fg=$color_status_text,bg=$color_window_off_status_bg" \;\
set window-status-current-format "#[fg=$color_window_off_status_bg,bg=$color_window_off_status_current_bg]$separator_powerline_right#[default] #I:#W# #[fg=$color_window_off_status_current_bg,bg=$color_window_off_status_bg]$separator_powerline_right#[default]" \;\
set window-status-current-style "fg=$color_dark,bold,bg=$color_window_off_status_current_bg" \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F12 \
@ravron
ravron / README.md
Last active February 3, 2025 13:23
Options to prevent accidental Yubikey OTP triggering

Tired of spamming Yubikey one-time password (OTP) codes into Slack? Here are two options to help prevent that. You can do either or both. Both require ykman, the Yubikey CLI configuration manager. Get it with Homebrew:

brew install ykman

If you…