Skip to content

Instantly share code, notes, and snippets.

@sancar
sancar / README.md
Last active April 22, 2024 16:15
An upgradable read write lock for go

And upgradable read write lock for go

UpgradableRWMutex is an enhanced version of the standard sync.RWMutex. It has the all methods sync.RWMutex with exact same semantics. It gives more methods to give upgradable-read feature.

The new semantics for upgradable-read are as follows:

  • Multiple goroutines can get read-lock together with a single upgradable-read-lock.
  • Only one goroutine can have a write-lock and no read-lock/upgradable-read-lock can be acquired in this state.
@ribice
ribice / caller.go
Last active July 7, 2023 07:07
A robust rabbitmq client for Go
go func() {
for {
err = rmq.Stream(cancelCtx)
if errors.Is(err, rabbitmq.ErrDisconnected) {
continue
}
break
}
}()
@BenjyWiener
BenjyWiener / Add Screen Recorder Button.py
Last active September 15, 2017 08:06
Screen recorder for Pythonista
# coding: utf-8
from objc_util import *
from ReplayKit import *
from console import alert
import ui
UIBarButtonItem = ObjCClass('UIBarButtonItem')
def main():
@eightyknots
eightyknots / avregex.md
Last active March 20, 2024 20:05
AvReg: Aviation regex match toolkit

AvReg: The Aviation RegEx Match Toolkit

General Tips

  • The PCRE flavour of RegEx is used here.
  • Append the i modifier to the end of the regex to make any pattern case-insensitive.

Aircraft

| Purpose | Description | RegEx | Example |

@0xabad1dea
0xabad1dea / rtlsdr-osx.txt
Created June 13, 2013 21:55
Build RTL-SDR on OSX with no tears
rtl-sdr build notes for OSX
using macports http://www.macports.org/
see http://sdr.osmocom.org/trac/wiki/rtl-sdr
sudo port install cmake
sudo port install libusb
sudo port install pkgconfig
sudo port install sox # for easy audio
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/