Skip to content

Instantly share code, notes, and snippets.

View a-b's full-sized avatar
🎯
Focusing

Al Berez a-b

🎯
Focusing
  • Broadcom
  • 16:36 (UTC -07:00)
View GitHub Profile
@a-b
a-b / alfred-kitty-applescript
Created August 3, 2023 08:00 — forked from alphashuro/alfred-kitty-applescript
AppleScript for using Alfred with kitty
on alfred_script(q)
set cmd to q
repeat while cmd starts with space
set cmd to cmd's text 2 thru -1
end repeat
tell application "kitty" to activate
do shell script "/Applications/Kitty.app/Contents/MacOS/kitty @ --to unix:/tmp/mykitty new-window --new-tab"
tell application "System Events" to keystroke cmd
tell application "System Events"
@a-b
a-b / LICENSE.md
Created December 30, 2022 06:19 — forked from sj26/LICENSE.md
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@a-b
a-b / iOS URL Schemes
Created September 10, 2021 23:43 — forked from bartleby/iOS URL Schemes
iOS URL Schemes
URL Schemes
Apple
 
Apple Music     — music://geo.itunes.apple.com/us/albums/<albumID>
                – music://geo.itunes.apple.com/us/artists/<artistID>
 
Apple News      — applenews://
App Store       — itms-apps://itunes.apple.com/app/<appID>
Apple TV        — videos://
@a-b
a-b / Makefile
Created February 12, 2020 01:51
Speed up ginkgo blur proposal
blur:
ginkgo blur $(git status -s | sed -r 's/^.{3}//' | xargs dirname | sort -u)
function gp() {
printf "GlobalProtect: "
case $1 in
on)
echo ON
launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangpa.plist
launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangps.plist
;;
*)
echo OFF
@a-b
a-b / venn-diagrams.js
Created April 15, 2018 19:01 — forked from yurivish/venn-diagrams.js
Area-proportional Venn Diagrams
// Since `overlapArea` function is monotonic increasing, we can perform a
// simple bisection search to find the distance that leads to an overlap
// area within epsilon of the desired overlap.
function distanceForOverlapArea(r1, r2, desiredOverlap) {
// Ensure r1 <= r2
if (r1 > r2) {
var temp = r2;
r2 = r1;
r1 = temp;
}
@a-b
a-b / postmortem.md
Created July 20, 2017 22:55 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym
@a-b
a-b / .vimrc
Created February 5, 2016 03:47 — forked from robbintt/.vimrc
Toggle tab size in .vimrc with <f3>. Doesn't set initial conditions.
" Apparently some vim environments require colons before commands in
" .vimrc and others don't. This file has been primarily tested in
" Ubuntu 12.04, 13.10, and 14.04 environments, where a : is required
" on each line before a command. According to one stackexchange topic
" it is best to leave the leading colons because systems that do not
" require them can still execute them.
" Author - Trent Robbins
:set background=dark
@a-b
a-b / springer-free-maths-books.md
Created December 28, 2015 20:18 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@a-b
a-b / README.md
Created November 26, 2015 08:46 — forked from wvengen/README.md
Ruby memory analysis over time

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the