Skip to content

Instantly share code, notes, and snippets.

@warrenseine
warrenseine / aws-vpn-auto-close.user.js
Last active January 24, 2023 12:40
Tampermonkey AWS VPN Auto-Close
// ==UserScript==
// @name AWS VPN Auto-Close
// @namespace http://tampermonkey.net/
// @match http://127.0.0.1/
// @grant window.close
// @version 1.0
// @author Warren Seine
// @description Close the tab when successful AWS VPN is on
// @icon https://a0.awsstatic.com/libra-css/images/site/fav/favicon.ico
// ==/UserScript==
@tclementdev
tclementdev / libdispatch-efficiency-tips.md
Last active June 27, 2024 10:27
Making efficient use of the libdispatch (GCD)

libdispatch efficiency tips

The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).

My take-aways are:

  • You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.

  • Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse

@lattner
lattner / TaskConcurrencyManifesto.md
Last active June 29, 2024 14:26
Swift Concurrency Manifesto
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@baopham
baopham / Monaco for Powerline.otf
Last active April 16, 2023 03:57
Patched font Monaco for OSX Vim-Powerline
@mxcl
mxcl / tdb
Created June 22, 2010 10:25
Makes ADB logcat more readible (for me)
#!/usr/bin/ruby
RED = "\033[0;31m"
RESET = "\033[0m"
YELLOW = "\033[0;33m"
BLUE = "\033[0;35m"
GREY = "\033[0;34m"
trap("INT") { puts; exit! 127 }