Skip to content

Instantly share code, notes, and snippets.

View patcon's full-sized avatar

Patrick Connolly patcon

View GitHub Profile
@aileftech
aileftech / hex-colors.txt
Created October 1, 2022 18:10
A Bash one-liner to produce a list of HEX color codes that read like (supposedly) valid English words
$ grep -P "^[ABCDEFabcdefOoIi]{6,6}$" /usr/share/dict/words | tr 'OoIi' '0011' | tr '[:lower:]' '[:upper:]' | awk '{print "#" $0}'
#ACAD1A
#B0BB1E
#DEBB1E
#AB1DED
#ACAC1A
#ACCEDE
#AC1D1C
#BAB1ED
#BA0BAB
@tomhicks
tomhicks / plink-plonk.js
Last active July 26, 2024 01:10
Listen to your web pages

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@VictorNine
VictorNine / fbMatter.py
Created February 7, 2019 20:22
facebook module for matterbridge
import json
import requests
from fbchat import log, Client
# Subclass fbchat.Client and override required methods
class FBListener(Client):
def onMessage(self, author_id, message_object, thread_id, thread_type, **kwargs):
self.markAsDelivered(thread_id, message_object.uid)
self.markAsRead(thread_id)
@easherma
easherma / did_i_do_that.md
Last active January 23, 2018 16:57
Did I Do That?

Did I do that?

Problem

Reduplication of work is very common in both the civic tech and open source space.

For lots of reasons (expand).

To address this, in the community it is often proposed to have a list of resources or existing projects. While an obvious solution, it has several fundamental challenges, such as:

  • It is hard for one or a small group of people to know everything that is going on
  • Someone has to maintain this resource or else relevance slowly declines and leads to stagnation
@twolfson
twolfson / README.md
Last active November 21, 2023 11:43
Audit logging via sequelize

We prefer to have audit logging in our services that leverage databases. It gives us clarity into sources of where ACL issues might originate as well as gives us a general timeline of activity in our application.

Audit logging is tedious to set up so this gist contains our latest iteration of audit logging support for a sequelize based service.

@mikoim
mikoim / nginx.conf
Created October 28, 2016 21:22
Split RTMP Stream with nginx-rtmp-module
worker_processes 1;
events {
worker_connections 1024;
}
rtmp {
server {
listen 1935;
chunk_size 8192;
@rokotyan
rokotyan / .block
Last active December 12, 2023 13:07
Export SVG D3 visualization to PNG or JPEG
license: mit
@elipousson
elipousson / timelinejs-include.md
Created February 16, 2016 00:27
TimelineJS include for Jekyll

{% include timelinejs.html json-source="" %}

@patcon
patcon / README.md
Last active May 10, 2022 23:24
A parser for the City of Toronto subject thesaurus/taxonomy, helpful for searching tmmis with internal city tags (updated 2021-02-24)