Skip to content

Instantly share code, notes, and snippets.

View tree-s's full-sized avatar
👋

Michael J. MacMullin tree-s

👋
View GitHub Profile
@tree-s
tree-s / wp-recent-posts-include.php
Last active August 21, 2024 00:10
Fix for recent posts include
/**
* Recent_Posts widget w/ category include class
* This allows specific Category ID to be included in the Sidebar Recent Posts list
*
*/
class WP_Widget_Recent_Posts_Include extends WP_Widget {
function __construct() {
$widget_ops = array('classname' => 'widget_recent_entries', 'description' => __( "The most recent posts on your site") );
parent::__construct('recent-posts', __('Recent Posts with Include'), $widget_ops);
@tree-s
tree-s / batch-convert.sh
Last active August 21, 2024 00:10
Batch convert scripts for normalizing video file encoding
#!/bin/sh
################################################################################
#
# Script to recursively search a directory and batch convert all files of a
# given file type into another file type via HandBrake conversion.
#
# To run in your environment set the variables:
# hbcli - Path to your HandBrakeCLI
# ffmpeg - Path to the ffmpeg
@tree-s
tree-s / DDNS.applescript
Last active August 21, 2024 00:10
Applescript DDNS updater
property hostname : "__domain_name__.dyndns.org"
property dyndnsUsername : "__username__"
property dyndnsPassword : "__userpassword__"
property myLastIP : missing value
property myCurrentIP : missing value
property retryPeriodSeconds : 300
on idle
my updateDynDNS(myLastIP)
set myLastIP to result
@tree-s
tree-s / VPN.applescript
Last active August 21, 2024 00:10
VPN reconnect applescript
on idle
tell application "System Events"
tell current location of network preferences
set myConnection to the service "__vpn_service_name__"
if myConnection is not null then
if current configuration of myConnection is not connected then
connect myConnection
end if
end if
end tell
@tree-s
tree-s / tmux-resurrect.sh
Last active August 21, 2024 00:10
Resurrect tmux session backup/restore
#!/bin/bash
#######################
# Usage
usage() {
echo "USAGE: ${0} -b | -r [backup_number]"
exit 1
}
#######################
# Config Variables
@tree-s
tree-s / Makefile.global.diff
Last active August 21, 2024 00:10
homebrew-php update for Formula/abstract-php.rb
diff --git a/Makefile.global b/Makefile.global
index b30c318..e8dd419 100644
--- a/Makefile.global
+++ b/Makefile.global
@@ -20,7 +20,7 @@ libphp$(PHP_MAJOR_VERSION).la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
-@$(LIBTOOL) --silent --mode=install cp $@ $(phptempdir)/$@ >/dev/null 2>&1
libs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
- $(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp$(PHP_MAJOR_VERSION).so
+ $(CC) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(MH_BUNDLE_FLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp$(PHP_MAJOR_VERSION).so
@tree-s
tree-s / .nethackrc
Last active August 21, 2024 00:10
Big Sony Nethack Font
## This is an example nethackrc file. You should edit this to suit your needs
## Edit this on the NAO website: https://alt.org/nethack/webconf/
## or if in terminal, see https://alt.org/nethack/virus.txt
## curses options
OPTIONS=windowtype:curses
## use IBMgraphics or DECgraphics
#OPTIONS=symset:DECgraphics
@tree-s
tree-s / nethack.bdf
Last active August 21, 2024 00:10
Big Sony Nethack characters
STARTFONT 2.1
COMMENT
COMMENT This font is a modification of the Sony 12x24 font distributed
COMMENT with X11. The Sony copyright and license agreement are below.
COMMENT
COMMENT Modifications for Nethack: Copyright 1998-2002
COMMENT by Thomas A. Fine
COMMENT Email to my last name at head.cfa.harvard.edu
COMMENT http://hea-www.harvard.edu/~fine/
COMMENT
@tree-s
tree-s / config.yml
Last active August 21, 2024 00:09
Flexget archiso
tasks:
arch_task:
regexp_parse:
source: 'https://www.archlinux.org/download/'
keys:
title:
regexps:
- {regexp: '(?<=title=\"Magnet link\">)[a-zA-Z0-9\.\s]*'}
url:
regexps:
@tree-s
tree-s / foreground-lock-timeout.reg
Last active August 21, 2024 00:09
--prevent applications from stealing focus on Windows 10
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\Desktop]
"ForegroundLockTimeout"=dword:00000000