Skip to content

Instantly share code, notes, and snippets.

@jsit
jsit / sieve.sieve
Last active Aug 12, 2022
Notifications / mailing lists / bulk email sieve code (for e.g. Fastmail et al.)
View sieve.sieve
if
# Tests for "Mailing Lists"
anyof(
header :is "X-ME-VSCategory" "community:mailing-list",
header :contains "X-Mailer" "Sympa",
exists [
"List-Id",
"List-Help",
"List-Subscribe",
"List-Unsubscribe",
@jsit
jsit / webdev.goggles
Last active Jul 8, 2022
Web Development Goggles
View webdev.goggles
! name: Web Development Sites
! description: Search nothing but web development sites
! public: false
! author: Jay Sitter
$discard
$boost,site=css-tricks.com
$boost,site=smashingmagazine.com
$boost,site=alistapart.com
$boost,site=csswizardry.com
@jsit
jsit / functions.php
Last active May 29, 2022
Customize WordPress comment form output
View functions.php
<?php
/**
* Rewrite the HTML for the author, email, and url comment fields
*/
function custom_comment_fields( $fields ) {
// https://codex.wordpress.org/Function_Reference/comment_form
$commenter = wp_get_current_commenter();
@jsit
jsit / kottke-recommends.opml
Last active May 11, 2022
Kottke Recommends OPML
View kottke-recommends.opml
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.1">
<head>
<title>Kottke Recommended Follows</title>
</head>
<body>
<outline text="Kottke Recommends" title="Kottke Recommends">
<outline title="A Thing Or Two" xmlUrl="https://www.athingortwohq.com/newsletter?format=rss"/>
<outline title="A Whole Lotta Nothing" xmlUrl="https://a.wholelottanothing.org/feed/"/>
<outline title="Anil Dash" xmlUrl="https://anildash.com/rss/"/>
View keybase.md

Keybase proof

I hereby claim:

  • I am jsit on github.
  • I am jays (https://keybase.io/jays) on keybase.
  • I have a public key whose fingerprint is 0B61 0F1F 2188 2218 5930 D6A9 CF75 BDF8 9AA7 EF4D

To claim this, I am signing this object:

@jsit
jsit / Wordle Streak Transfer.txt
Last active Feb 27, 2022
Wordle Streak Transfer
View Wordle Streak Transfer.txt
https://www.nytimes.com/games/wordle/index.html?data={%22statistics%22:{%22currentStreak%22:32,%22maxStreak%22:32,%22guesses%22:{%221%22:0,%222%22:1,%223%22:5,%224%22:20,%225%22:11,%226%22:6,%22fail%22:1},%22winPercentage%22:98,%22gamesPlayed%22:44,%22gamesWon%22:43,%22averageGuesses%22:4}}
View removeUTMCodes.js
javascript:(function()%7Bvar%20tidyurl=window.location.href.replace(/utm_(term%7Ccontent%7Csource%7Cmedium%7Ccampaign)=%5B%5E&%5D+&?/g,%22%22).replace(/mc_(eid%7Ccid)=%5B%5E&%5D+&?/g,%22%22).replace(/ref=%5B%5E&%5D+&?/g,%22%22).replace(/%5C??$/g,%22%22);if(history.replaceState)%7Bhistory.replaceState(null,%22%22,tidyurl)%7Delse%7Bwindow.location=tidyurl%7D%7D)();
@jsit
jsit / kill_idiot.sl
Created Jun 22, 2021
Kill messages from user and all replies to messages from user in slrn
View kill_idiot.sl
% Path: pingwin.icm.edu.pl!agh.edu.pl!news.wnaft.agh.edu.pl!news.memax.krakow.pl!news.sim.pl!lublin.pl!uw.edu.pl!news.nask.pl!orion.cst.tpsa.pl!news.task.gda.pl!news.icm.edu.pl!home.extravaganza.pl!jr211
% From: jr211@students.mimuw.edu.pl (Jan Rekorajski)
% Newsgroups: pl.comp.os.advocacy
% Subject: Re: Dajcie =?iso-8859-2?Q?ju=BF_spok=F3j?= Expertowi
% Date: 12 Apr 1999 02:38:42 GMT
% Organization: The Shire
% Lines: 249
% Message-ID: <slrn7h2n5i.17q.jr211@home.extravaganza.pl>
% References: <N6VM2.4295$_u5.498155@news.tpnet.pl> <370A77BD.7FDDBAED@vela.filg.uj.edu.pl> <Pine.LNX.4.02.9904070915210.829-100000@manjak.knm.org.pl> <c7g16c39by.fsf@home.bti.pl> <slrn7gn3dv.s0.druzus@uran.nat.org.pl> <370BD987.C4BDC2D8@fnet.pl>
% NNTP-Posting-Host: pf157.warszawa.ppp.tpnet.pl
@jsit
jsit / soundcloud.php
Last active Jun 7, 2021
PHP preg_replace strings for AMP HTML extensions
View soundcloud.php
$body = preg_replace( '/<iframe\b[^>]*soundcloud.com\/tracks\/(\d*).*"[^>]*>(.*?)>/', '<amp-soundcloud height=300 layout="fixed-height" data-trackid="$1" data-visual="true"></amp-soundcloud>', $body );
@jsit
jsit / .gitconfig
Created Dec 22, 2020
Git config with conditional to test Git version
View .gitconfig
[alias]
lg = "!if (( \
$(echo \"$(git --version | sed -E 's/git version ([0-9]+.[0-9]+).*/\\1/') > 2.20\" | bc) \
)); then \
DATE="--date=human"; \
else \
DATE="--date=short"; \
fi; \
git log --pretty=tiny --abbrev-commit --$DATE"