Skip to content

Instantly share code, notes, and snippets.

@absurd
absurd / gist:63359db9cf839945e4584c0730e3ad52
Created March 10, 2022 05:11
CSS Selector for Removing Non-Followed Suggested Posts on Twitter.com (e.g. w/ UBlock Origin)
##article:has(div>div>div>div>div>div>div>div>div>div>div>a>span:has-text(/See more/))
@absurd
absurd / keybase.md
Created September 23, 2018 03:30
keybase.md

Keybase proof

I hereby claim:

  • I am absurd on github.
  • I am absurd (https://keybase.io/absurd) on keybase.
  • I have a public key ASCiJNfRGyDlJotXzGuetCtMVX8IMS3CtmjSMSI09TzZXAo

To claim this, I am signing this object:

@absurd
absurd / yarn-voice-start.sh
Created July 9, 2018 01:34
yarn start (for create-react-app) with voice notifications
#!/usr/bin/env bash
unbuffer yarn start | tee >(
while read line
do
if [[ "$line" = *"Starting the development server"* ]]
then
echo "Starting the development server" | say -v Vicki -r 250
elif [[ $line = *"Compiled"* ]]
then
@absurd
absurd / emalias.sh
Last active March 20, 2018 07:02
Emalias -- shell script to quickly generate Postfix email aliases
#!/usr/local/bin/zsh
default_address="you@example.com"
if [ -t 0 ]; then
# read more about heredocs (the <<ENDSSH ... ENDSSH part): https://en.wikipedia.org/wiki/Here_document
ssh you@$EMAIL_SERVER_IP <<ENDSSH
echo "$1@example.com $default_address" | sudo tee -a /etc/postfix/virtual \
&& sudo postmap /etc/postfix/virtual \
&& sudo service postfix restart
ENDSSH
@absurd
absurd / twitter_filter.css
Created March 16, 2018 18:28
Twitter Hide Suggested/Liked Tweets
@-moz-document domain(twitter.com) {
li[data-suggestion-json*="ActivityTweet"] {
display: none;
}
}
@absurd
absurd / gist:04a57c863b4df18e6b557b51d8ad6bc7
Created March 11, 2018 23:23
bin/pylint virtualenv load plugins kludge v1
#!/Users/you/.virtualenvs/yourproject/bin/python3.6
# -*- coding: utf-8 -*-
import re
import sys
from pip.operations.freeze import freeze
from pylint import run_pylint
if __name__ == '__main__':
04bf5e1c53bca2d919952149caebe350c9e3fdb632045960ad48513f45d63f9a9ea58057eac010652292772b69763c75e8f7f7acef8ae3094b7903a9bcaa6da803
@absurd
absurd / unfalse_poem.py
Last active December 22, 2015 21:29
An unfalse poem that evaluates properly.
# Copyright 2013AD Gallus Absurd
def unfalse_poem():
None is not True or False
for subject in [complex(True,False)]:
subject is not object
for certainty in [complex(False,True)]:
certainty is not Exception
certainty is not license
@absurd
absurd / generator_wrapper.py
Last active December 17, 2015 04:49
There's probably a better idiom for wrapping an sql cursor iterator in a generator function.
def foo():
conn = sqlite3.connect(DATABASE_FILENAME)
c = conn.cursor()
c.execute(SQL_QUERY)
output = True
while output:
output = c.fetchone()
if output:
yield output
else:
@absurd
absurd / quadtree_to_array.py
Created March 25, 2013 18:45
Method and helper method snippet from a quadtree node class. Returns square 2d array representation of the quadtree.
# Just came out of the oven. Unclean and fugly.
#
# Key observation is that, when walking the array left-to-right
# and top-to-bottom, the "nw"/"ne"/"sw"/"se" attributes for the
# chain of subnodes down to the bottom have simple, power-of-2
# toggle periods.
#
# For example, to access the top-leftmost cell in a 32x32
# quadtree called foo:
#