Skip to content

Instantly share code, notes, and snippets.

View taylorthurlow's full-sized avatar

Taylor Thurlow taylorthurlow

View GitHub Profile
@taylorthurlow
taylorthurlow / distributed_read_write_lock.rb
Last active April 3, 2024 22:36
Multi-reader, multi-writer, read-preferring distributed lock implementation for Ruby, backed by Redis
# WARNING: This locking algorithm is not yet production-tested and should not
# be used in production without further testing. Testing on a local machine
# seems to suggest that things are working as expected, but I am anticipating
# that there will be edge cases that I have missed. If you find one then feel
# free to contact me.
#
# The goal of this class is to model and provide a distributed (Redis-backed)
# multiple-reader, multiple-writer lock.
#
# The lock is read-preferring, meaning that readers will be able to read
This file is used to be tracked and identified by https://lrc-maker.github.io
@taylorthurlow
taylorthurlow / dropshadow.sh
Last active November 10, 2017 03:03
A script which uses scrot and imagemagick to apply macOS-esque drop shadows to screenshots.
#!/bin/bash
# NAME: dropshadow.sh
# VERSION:
# AUTHOR: (c) 2017 Taylor Thurlow
# DESCRIPTION: - adds transparent dropshadow to images (e.g. screenshots)
# - moves them to predefined screenshot folder
# - notifies the user
# FEATURES:
# DEPENDENCIES: imagemagick suite
#