Skip to content

Instantly share code, notes, and snippets.

View jwenerd's full-sized avatar
workin'

Jared Wenerd jwenerd

workin'
View GitHub Profile
@jwenerd
jwenerd / web-servers.md
Created February 23, 2024 10:58 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jwenerd
jwenerd / roku-keypress.zsh
Last active February 21, 2024 19:05
Roku Play Pause
# assuming you are on macOS with zsh;
# assumes your roku is also setup to use Airplay (easier method to discover instead ARP discovery which requires sudo)
# requirements: gnu-coreutils timeout; curl;
# `brew install coreutils curl`
#
# usage:
# roku-keypress [remote-button (default = play if not specified)]
#
# for all available keypress values see
# https://developer.roku.com/docs/developer-program/dev-tools/external-control-api.md#keypress-key-values

🌊

All streams flow into the sea,
    yet the sea is never full.

To the place the streams come from,
    there they return again.

All things are wearisome,
    more than one can say.

@jwenerd
jwenerd / music-recognition.txt
Last active March 26, 2024 02:00
music-log
@jwenerd
jwenerd / README.md
Created January 13, 2024 02:03
Copy URL text From Chrome via AppleScript - save JSON

Copy a URL Body by Opening It in Chrome

Usage

osascript ./chrome-copy.scpt URL [FILE_TO_SAVE]

i.e:

--------------------------------------------------------------------------------------------------------
# FROM Global Search
SELECT Count(*)
FROM "pg_search_documents"
INNER JOIN
(
SELECT "pg_search_documents"."id" AS pg_search_id,
(Ts_rank((To_tsvector('simple', COALESCE("pg_search_documents"."content"::text, ''))), (To_tsquery('simple', ''' '
|| 'len'
@jwenerd
jwenerd / instructions.md
Last active July 11, 2017 15:33
DB copy instructions for Christine

The following outlines how to access the badges production server and copy the production database to your local machine to use for development.

ssh to server:

ssh -p 1855 badgesapp.vmhost.psu.edu

The badges application code and db is run with the user badgesapp. Start a shell session using this account with:

This file has been truncated, but you can view the full file.
A Beautiful Life
Each day I'll do a golden deed
By helping those who are in need
My life on earth is but a span
And so I'll do the best I can
   Life's evening sun is sinking low
   A few more days and I must go
<?php
/* The new responsive image feature in wordpress 4.4 causes image sourceset attribuet
to insert images as HTTP rather than HTTPS. This completely breaks images on sites where
the site is loaded ( and in sometimes force-loaded) to be served via HTTPS
The following plugin changes these images to be HTTPS if the site is served via HTTPS
*/
if ( is_ssl() ) {
add_filter('wp_calculate_image_srcset', 'psu_https_srcset_fix' , 100 , 5);
}
function psu_https_srcset_fix( $sources, $size_array, $image_src, $image_meta, $attachment_id ){
Array
(
[1441915864] => Array
(
[jetpack_clean_nonces] => Array
(
[40cd750bba9870f18aada2478b24840a] => Array
(
[schedule] => hourly
[args] => Array