Skip to content

Instantly share code, notes, and snippets.

View sitbon's full-sized avatar
🍄
Voraciously reading /dev/null

Phillip Sitbon sitbon

🍄
Voraciously reading /dev/null
  • Portland, OR, USA
  • 20:09 (UTC -08:00)
View GitHub Profile
@bretton
bretton / lightning-maps.md
Last active November 11, 2025 08:33
Visualisers of the Lightning Network (and some other explorers)

A (mostly) visual collection of the Lightning Network

Disclaimer

Network views tend to be the view of the network from a single node, or small selection of nodes. They are not complete views of the network. This is impossible to achieve. Even if many node views were combined, it would still be incomplete.

These network views, or network maps, have been termed 'visualisers' by the LN community.

Screenshots may reflect older visual styles, and are dated accordingly.

@david-sanabria
david-sanabria / pg_base62_encode.sql
Last active October 11, 2025 03:55
Base62 Encode/Decode functions for PostgreSQL.
/*
* This script will create base62_encode() and base62_decode() in the current schema of a postgresql database.
* Give it a star if you find it useful.
*/
CREATE OR REPLACE FUNCTION base62_encode( long_number bigint )
RETURNS text
AS $BODY$
/*
* base62_encode()
@lewisrodgers
lewisrodgers / README.md
Last active September 18, 2025 07:15
Python boilerplate for service account oauth setup to return data from a Google API

Prerequisites

For a more detailed version of the steps below visit: https://developers.google.com/admin-sdk/directory/v1/guides/delegation

  • Enable the necessary APIs (calendar, drive, gmail, etc.) in Cloud Console
  • Create a service account, download the json key file, and enable domain wide delegation (DwD)
  • Determine the required scopes (calendar readonly, drive read/write, etc.)
  • In the G Suite console, an admin authorizes the service account (client ID) with the specified scopes
  • The admin also identifies an account — with proper admin privileges — that the service account will impersonate (when you want to access user's data without manual authorization from the user)
@asktami
asktami / Fix Flash of Unstyled Content
Created May 5, 2018 05:22
Javascript to fix FOUC (Flash of Unstyled Content) - goes in html document HEAD
<head>
...
<!-- to fix FOUC (Flash of Unstyled Content) -->
<script type="text/javascript">
var elm=document.documentElement;
elm.style.display="none";
document.addEventListener("DOMContentLoaded",function(event) { elm.style.display="block"; });
</script>
@srstsavage
srstsavage / nginx_google_analytics
Last active August 6, 2025 05:27
google analytics in nginx
# send logs for all traffic (including non-html) to google analytics
#
# in server block:
# set $google_analytics_id "UA-THECORRECT-ID";
# include /srv/nginx/google_analytics;
#
# in location blocks:
# post_action @ga;
#
# notes: post_action has been referred to by nginx devs as a "dirty hack" and this approach may stop working one day.
@krisleech
krisleech / renew-gpgkey.md
Last active November 8, 2025 19:52
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@jacobtomlinson
jacobtomlinson / Dask on Fargate from scratch.ipynb
Last active November 4, 2025 15:28
Dask on Fargate from scratch
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pamolloy
pamolloy / README.md
Last active October 16, 2024 20:40
Ubiquiti USG configuration for Wireguard

Download the latest ugw3 package from https://github.com/Lochnair/vyatta-wireguard/releases and install it on your USG using dpkg -i wireguard-ugw3-<version>.deb.

cd /config/auth
umask 077
mkdir wireguard
cd wireguard
wg genkey > wg_private.key
wg pubkey < wg_private.key > wg_public.key
@ismith
ismith / cc.png
Last active January 19, 2021 23:43
Dark's caption embedding script
cc.png
@dirkjonker
dirkjonker / nginx.conf
Last active December 5, 2022 11:10
NGINX JSON log configuration for Google Cloud / StackDriver log format
# this outputs JSON formatted logs which are easy to parse for any logging agent (such as fluentd)
# the format conforms to Google Cloud Logging so logs are nicely structured in the logs viewer
# see also: https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#httprequest
# put the following lines in your nginx config
# /etc/nginx/nginx.conf
log_format json_combined escape=json
'{'
'"time":"$msec",'