Skip to content

Instantly share code, notes, and snippets.

View Downes's full-sized avatar

Stephen Downes Downes

View GitHub Profile
@Downes
Downes / gist:074f05fcb5bc2e61c720d421bd6e3a7d
Created September 26, 2025 12:42
Read Later - Pinboard
javascript:q=location.href;p=document.title;void(t=open('https://pinboard.in/add?later=yes&noui=yes&jump=close&url='+encodeURIComponent(q)+'&title='+encodeURIComponent(p),'Pinboard','toolbar=no,width=100,height=100'));t.blur();
@Downes
Downes / gist:619be8953c3ad16ddffb9a83c4843901
Created September 25, 2025 19:44
OCR webp with Python
pip install easyocr
Then create ocr.py
import easyocr
reader = easyocr.Reader(['en']) # supports many languages
result = reader.readtext('page1.webp', detail=0)
print("\n".join(result))
javascript:void%20function(){var%20a=Math.min,b=Math.max;const%20c=b(document.documentElement.clientWidth||0,window.innerWidth||0),d=b(document.documentElement.clientHeight||0,window.innerHeight||0),e=a(c,900),f=a(d,1000);var%20g=window.location.href,h=document.title,i=%22%22;document.getSelection()%26%26(i=document.getSelection()),newUrl=`https://www.downes.ca/cgi-bin/api.cgi%3Fcmd=edit%26id=new%26table=post%26hub=yes%26url=${g}%26quote=${i}`,window.open(newUrl,%22%22,%22width=%22+e+%22,%20height=%22+f)}();
@Downes
Downes / gist:07b26f98998276d1949676f6ef313436
Created March 26, 2023 13:45
Mastodon Flickr Button Killer
javascript:(
function(){
var divsToHide = document.getElementsByClassName('status-card__actions');
for(var i = 0; i < divsToHide.length; i++){
divsToHide[i].style.display = "none";
}
}
)
()
@Downes
Downes / vhost.sh
Last active April 22, 2025 11:23 — forked from mattmezza/vhost.sh
bash script to create virtual host vhost with apache2 and Ubuntu
#!/bin/bash
# This script was originally used for create virtual hosts on CentOs.
# Created by alexnogard from http://alexnogard.com
# Improved by mattmezza from http://you.canmakethat.com
# Adapted for Apache2 on Ubuntu by Stephen Downes at https://www.downes.ca
# Feel free to modify it
# PARAMETERS
#
# $usr - User
# $dir - directory of web files
<date time=now;format=nice>
<box box_title>
[*table_field*]