Skip to content

Instantly share code, notes, and snippets.

View phocks's full-sized avatar
🦖
"Rrrrrraaaawwwwwr!!" —A dinosaur

Joshua Byrd phocks

🦖
"Rrrrrraaaawwwwwr!!" —A dinosaur
View GitHub Profile
@sjlongland
sjlongland / gh36273-4.4.5.patch
Created October 14, 2025 10:35
Mastodon GH36273 fix backported to Mastodon 4.4.5
diff --git a/app/lib/request.rb b/app/lib/request.rb
index 4858aa4bc..de67d1659 100644
--- a/app/lib/request.rb
+++ b/app/lib/request.rb
@@ -65,6 +65,7 @@ class Request
# and 5s timeout on the TLS handshake, meaning the worst case should take
# about 15s in total
TIMEOUT = { connect_timeout: 5, read_timeout: 10, write_timeout: 10, read_deadline: 30 }.freeze
+ SAFE_PRESERVED_CHARS = '+,'
@phocks
phocks / paywall-block-list.txt
Last active August 28, 2025 04:22
Just a list of URLs to block that may or may not affect paywalls on various sites
! Hide "This is your last free article" banners
! REQUIRED: Use "Forget Me Not" to block cookie: pay_ent_msmp@*.newyorker.com
! to actually block the paywall. (Change domain to suit)
! UPDATE 2025: No longer works. Block "build" js instead as below.
! vanityfair.com##.journey-unit__container
! wired.com##.journey-unit__container
! newyorker.com##.journey-unit__container
! gq.com##.journey-unit__container
! Brisbane Times & Fairfax sites
// Update 2025-05-22 — ported to rand v0.9, using a struct with Display impl rather than returning a string
struct MarineLine;
impl std::fmt::Display for MarineLine {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
use rand::{Rng, seq::IndexedRandom};
let marine_life = ["🐳", "🐠", "🦈", "🐙", "🐡", "🐬", "🐟", "🦀", "🐋"];
let water = [
@melroy89
melroy89 / mastodon-docker-setup.md
Last active June 25, 2026 01:34 — forked from akuechl/mastodon-docker-setup.md
Mastodon Docker Setup - most complete and easiest guide online
// ==UserScript==
// @name @chaoticvibing Twitter Blue Nerd - twitter.com
// @namespace Violentmonkey Scripts
// @match *://*.twitter.com/*
// @match *://*.x.com/*
// @grant none
// @version 1.9.2
// @author @chaoticvibing - GH @busybox11
// @description 11/9/2022, 11:45:28 PM
// @updateURL https://gist.githubusercontent.com/busybox11/53c76f57a577a47a19fab649a76f18e3/raw
@PadraigK
PadraigK / generics.swift
Created May 12, 2022 00:21
Function signatures with generics
func makeOrReuse<T : IdentifierCellView>(_ cellType: T.Type, tableView: NSTableView) -> T
func makeOrReuse<T : IdentifierCellView>(tableView: NSTableView) -> T
// IMHO: The first signature is vastly superior even though the first argument is unncessary.
// Think about the call sites
let cell = makeOrReuse(ImageExportOptionCells.Toggle.self, tableView: tableView)
@shirakaba
shirakaba / vite-configuration.md
Last active November 18, 2024 03:50
How to configure Vite from svelte.config.js in SvelteKit projects

SvelteKit

In SvelteKit projects, SvelteKit wraps around Vite.

This example is for configuring path aliases, but you get the idea. There's a kit.vite property in svelte.config.js, and you'd configure vite through there.

https://kit.svelte.dev/faq#aliases

Vite's plugins should be API-compatible with Rollup, to my understanding.

{
"Darwin City": 800,
"Alawa": 810,
"Brinkin": 810,
"Casuarina (NT)": 810,
"Coconut Grove": 810,
"Jingili": 810,
"Lee Point": 810,
"Lyons (NT)": 810,
"Millner": 810,
@n1ru4l
n1ru4l / offscreen-canvas-polyfill.js
Created August 28, 2019 09:24
offscreen-canvas-polyfill.js
if (!window.OffscreenCanvas) {
window.OffscreenCanvas = class OffscreenCanvas {
constructor(width, height) {
this.canvas = document.createElement("canvas");
this.canvas.width = width;
this.canvas.height = height;
this.canvas.convertToBlob = () => {
return new Promise(resolve => {
this.canvas.toBlob(resolve);
@akrisiun
akrisiun / promise.js.md
Last active January 31, 2021 10:35
Javascript Polyfill promise for IE11 + script type="model" loader