Skip to content

Instantly share code, notes, and snippets.

@erchn
erchn / ipv4 regex.txt
Last active February 5, 2019 21:36
Match Cloudflare IPs with regex
# https://www.cloudflare.com/ips/
# this is not meant to catch malformed IPs
/(103\.21\.24[4567]\.[0-9]+ # 103.21.244.0/22
|103\.22\.20[0123]\.[0-9]+ # 103.22.200.0/22
|103\.31\.[4567]\.[0-9]+ # 103.31.4.0/22
|104\.(1[6789]|2[0-9]|3[01])\.[0-9]+ # 104.16.0.0/12
|108\.162\.(19[2-9]|2[0-9]+)\.[0-9]+ # 108.162.192.0/18
|131\.0\.7[2345]\.[0-9]+ # 131.0.72.0/22
|141\.101\.(6[4-9]|[7-9][0-9]|1[01][0-9]|12[0-7])\.[0-9]+ # 141.101.64.0/18
{
"title": "Launch new Chrome or iTerm2 windows via keybindings",
"rules": [
{
"description": "caps lock - launches a new iTerm2 window with the default profile",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
@erchn
erchn / alphabet.py
Last active January 23, 2023 18:29
Over engineered helper for Slack trolling
#!/usr/bin/env python3
import subprocess
from string import ascii_letters
from optparse import OptionParser
parser = OptionParser()
parser.add_option(
"-y",