Skip to content

Instantly share code, notes, and snippets.

View sdenaro's full-sized avatar

sal sdenaro

View GitHub Profile
@bramus
bramus / bookmarklet.md
Last active August 3, 2023 16:56
Mastodon User Page Bookmarklet
@joeybaumgartner
joeybaumgartner / man2pdf.sh
Last active December 21, 2023 06:23
Script for opening PDF documents in Preview on macOS Ventura and newer.
#!/bin/sh
if [ $# -lt 1 ]
then
echo “man2pdf [man page name]”
exit
fi
tempfoo=`basename $0`
TMPPDFFILE=`mktemp /tmp/${tempfoo}.XXXXXX` || exit 1
@dxdxdt
dxdxdt / fuckyou-gmail.en.md
Last active September 7, 2023 17:44
What to do when Gmail marks all the mails from your server as spam

What to do when Gmail marks all the mails from your server as spam

If you're self-hosting your services and having trouble getting your emails through Gmail and infuriated by Google's non-existent support, you're not the only one. I'd like to share my experiences trying to get it sorted out.

I'm the author of the post above. You can tell how arrogant Google employees are from all the previous posts he made in the past.

function getLastResource(time, regex) {
let entries = performance.getEntriesByType('resource')
let last = null;
for(let i = 0; i < entries.length; i++) {
let e = entries[i];
if(regex && !e.name.match(regex)) continue;
if(e.responseEnd < time) last = e;
}
return last;
}
@IanColdwater
IanColdwater / twittermute.txt
Last active July 2, 2024 02:25
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@jcenters
jcenters / maclinkhandler
Created October 16, 2019 14:38
Link Handler for the Mac
#!/usr/bin/env sh
# Feed script a url or file location.
# If an image, it will view in the default image view (probably Preview),
# if a video or music file, it will view in mpv
# otherwise it opens link in browser.
# If no url given. Opens browser. For using script as $BROWSER.
[ -z "$1" ] && { "$BROWSER"; exit; }
@korakot
korakot / selenium.py
Last active July 11, 2024 02:09
Use selenium in Colab
# install chromium, its driver, and selenium
!apt update
!apt install libu2f-udev libvulkan1
!wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
!dpkg -i google-chrome-stable_current_amd64.deb
!wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.70/linux64/chromedriver-linux64.zip
!unzip -j chromedriver-linux64.zip chromedriver-linux64/chromedriver -d /usr/local/bin/
!pip install selenium chromedriver_autoinstaller
# set options to be headless, ..
@jakub-g
jakub-g / async-defer-module.md
Last active July 15, 2024 12:12
async scripts, defer scripts, module scripts: explainer, comparison, and gotchas

<script> async, defer, async defer, module, nomodule, src, inline - the cheat sheet

With the addition of ES modules, there's now no fewer than 24 ways to load your JS code: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- and each of them is subtly different.

This document is a comparison of various ways the <script> tags in HTML are processed depending on the attributes set.

If you ever wondered when to use inline <script async type="module"> and when <script nomodule defer src="...">, you're in the good place!

Note that this article is about <script>s inserted in the HTML; the behavior of <script>s inserted at runtime is slightly different - see Deep dive into the murky waters of script loading by Jake Archibald (2013)

title: $:/config/tiddlyweb/host
$protocol$//$host$/tw/
@loziju
loziju / macosx-configure-postfix-as-relay.md
Last active July 11, 2024 00:06
Configure postfix as relay for OS X