Skip to content

Instantly share code, notes, and snippets.

View kodi's full-sized avatar

Dragan Bajcic kodi

View GitHub Profile
jerieljan /
Created May 22, 2021 13:32
Screenshot OCR with BetterTouchTool on MacOS
#!/usr/bin/env bash
# Usage:
# - Install `tesseract` with `brew install tesseract`
# - In BetterTouchTool, create a trigger of your choice.
# (I recommend a Keyboard Shortcut with Cmd+Shift 6)
# - Add an Execute Shell Script / Task action
# - Paste this script.
# NOTE: You'll need to authorize BTT to the Screen Recording permission in Security and Privacy at System Preferences
adamreisnz /
Last active April 13, 2024 17:01
A script to automate merging of release branches
#!/usr/bin/env bash
# Assuming you have a master and dev branch, and that you make new
# release branches named as the version they correspond to, e.g. 1.0.3
# Usage: ./ 1.0.3
# Get version argument and verify
if [ -z "$version" ]; then
echo "Please specify a version"
Rich-Harris /
Last active April 9, 2024 08:18
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

ChuckJHardy /
Last active October 22, 2021 23:03
ZeroMQ + Node.js + + UI for sending message from Ruby to a Javascript UI running on Node.js

Install the following requirements:

brew info zeromq
npm install zmq
npm install
gem install ffi-rzmq

Within the app directory run the following commands in different panes.

ruby worker.rb