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
@phocks
phocks / paywall-block-list.txt
Last active February 17, 2025 02:33
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
fn marine_line() -> String {
use rand::{seq::SliceRandom, Rng};
let marine_life = ["🐳", "🐠", "🦈", "🐙", "🐡", "🐬", "🐟", "🦀", "🐋"];
let water = [
"\x1B[38;2;0;100;200m≈\x1B[0m",
"\x1B[38;2;10;110;210m≈\x1B[0m",
"\x1B[38;2;20;120;220m≈\x1B[0m",
"\x1B[38;2;30;130;230m≈\x1B[0m",
"\x1B[38;2;40;140;240m≈\x1B[0m",
// ==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,
@akrisiun
akrisiun / promise.js.md
Last active January 31, 2021 10:35
Javascript Polyfill promise for IE11 + script type="model" loader
@andywer
andywer / _readme.md
Last active January 8, 2025 04:42
React - Functional error boundaries

React - Functional error boundaries

Thanks to React hooks you have now happily turned all your classes into functional components.

Wait, all your components? Not quite. There is one thing that can still only be implemented using classes: Error boundaries.

There is just no functional equivalent for componentDidCatch and deriveStateFromError yet.

Proposed solution

@colingourlay
colingourlay / key.md
Created February 28, 2019 02:54
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@daverickdunn
daverickdunn / stream_listener.js
Last active August 22, 2021 22:34
Stellar JS SDK listen to server streamed EventSource events
const StellarSdk = require('stellar-sdk');
StellarSdk.Network.useTestNetwork(); // StellarSdk.Network.usePublicNetwork();
const server = new StellarSdk.Server('https://horizon-testnet.stellar.org'); // const server = new StellarSdk.Server('https://horizon.stellar.org');
// convenience method: returns a PaymentCallBuilder
// https://stellar.github.io/js-stellar-sdk/PaymentCallBuilder_PaymentCallBuilder.html#stream
// there are similar CallBuilders for other network events, this one is specific to payments
var stream = server
.payments()