Skip to content

Instantly share code, notes, and snippets.

@douglaswth
douglaswth / SBPL NYT.js
Created July 17, 2022 03:06
Bookmarklet to access New York Times articles through the Santa Barbara Public Library's digital access
javascript:void(location.host = location.host.replace(/^(.+)\.nytimes\.com$/, function(_, p1) { return p1.replace('.', '-') + '-nytimes-com.sbpl.idm.oclc.org' }))

Keybase proof

I hereby claim:

  • I am douglaswth on github.
  • I am douglaswth (https://keybase.io/douglaswth) on keybase.
  • I have a public key ASB9YluR_DPrWN5aU_q4_nvzlUD1J-R_tOs7BtRF5VU5zgo

To claim this, I am signing this object:

@douglaswth
douglaswth / Update-Force-Test-0.md
Last active June 23, 2017 03:04
Update Force Test Report #powershell #chocolatey
@douglaswth
douglaswth / Update-AUPackages.md
Last active April 7, 2025 16:28
Update-AUPackages Report #powershell #chocolatey
# Bash Logout
#
# Douglas Thrift
#
# .bash_logout
if [[ `< /proc/sys/kernel/osrelease` =~ Microsoft ]]; then
backgrounds=(`pgrep 'tmux|screen'`)
if [[ ${#backgrounds[@]} -ne 0 ]]; then
bashes=(`pgrep 'bash$'`)
@douglaswth
douglaswth / flickr url.js
Last active July 17, 2022 03:06
Bookmarklet to get from a Flickr image URL to its photo page
javascript:void(location.href=location.href.replace(new RegExp('^https?://farm.+\.static\.?flickr\.com/.+/(.+?)_.+(?:_[mstzbo])?\.(?:jpg|gif|png)$'), 'https://flickr.com/photo.gne?id=$1'))
require "ffi"
module GetPass
extend FFI::Library
case RbConfig::CONFIG["host_os"]
when "cygwin"
ffi_lib "win1"
else
ffi_lib "libc"