Skip to content

Instantly share code, notes, and snippets.

@rwilcox
rwilcox / checklister-helper.js
Created November 17, 2025 15:48
checklister tampermonkey api example script
// ==UserScript==
// @name Checklister Helper
// @namespace http://tampermonkey.net/
// @version 1.0.0
// @description Example userscript for Checklister app
// @author You
// @match https://checklister-beta.wilcoxd.com
// @match http://localhost:3000/*
// @grant none
// ==/UserScript==
on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text
end replace_chars
@rwilcox
rwilcox / email.plist
Created November 23, 2011 05:37
Super Simple Email Codeless Language Module for BBEdit
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!--
BBEdit codeless language module for email (for example, what comes out of Mutt when you use "bbedit -w" as its editor)
Feel free to customize.
By Ryan Wilcox
Requires BBEdit 8.0 or higher. To install, copy here:
// ==UserScript==
// @name Hide Workona Sidebar
// @namespace workona
// @version 1.0
// @description Hides the element with the id "sidebar"
// @match https://workona.com/0/*
// @grant none
// ==/UserScript==
(function() {
@rwilcox
rwilcox / services.markdown
Created September 21, 2011 20:26
How to create a new gist from OS X Service

How to create a Public Gist Service:

Step 0: Open Automator, New Service.

Step 1: Drag out Run Shell Script action. Pass Input to STDIN

Step 2: This code:

open `gist`
@rwilcox
rwilcox / bbedit_selection_insert_text.applescript
Created August 3, 2012 13:36
BBEdit Rectangular Section Insert Text
tell application "BBEdit"
display dialog "What text to do want to insert at your column selection? (make sure to add a space if you need!)" default answer "hello world"
set textToInsert to text returned of the result
set oldClip to get the clipboard
set the clipboard to textToInsert
paste column
set the clipboard to oldClip
@rwilcox
rwilcox / run_selection_as_clipping.applescript
Created August 14, 2012 13:51
Run the current selection as a BBEdit clipping
tell application "BBEdit"
set theScript to selection as text
set clippingFileRef to (path to temporary items as string) & "clipping_as_selection"
--close access clippingFileRef
set fileref to open for access file clippingFileRef with write permission
set eof of fileref to 0 -- clear the file
write theScript to fileref
close access fileref
@rwilcox
rwilcox / github_remove_relative_date_greasemonkey.user.js
Last active June 12, 2024 18:25
Remove Github's relative date
// ==UserScript==
// @name Github remove relative date stupidness
// @namespace http://www.wilcoxd.com
// @include https://github.com*
// @version 1
// @grant none
// ==/UserScript==
// created: WD-rpw 03-25-2013
@rwilcox
rwilcox / each_line_to_file.py
Created August 2, 2012 13:21
Sends each line in the current BBEdit document to its own file
#!/usr/bin/env python
# A simple script that takes each line of the currently open (and saved!) document
# and outputs a file for each line, named with the first matching group of the name_grep
# regex
#
# It saves its output to a folder named "output" on the desktop
#
# Not really meant for general consumption, but as a tool that gets modified with every new
# time you have to do this.
@rwilcox
rwilcox / many_parameters_fill_out_missing.rb
Last active October 4, 2023 21:14
My starter template for creating scripts with lots of parameters that also prompt you to fill out the missing parameters
#!/usr/bin/env ruby
# Why not bash?
# bash is annoying for opts handling
# AND especially annoying if those opts need to be in both --key value AND --key=value format
# AND not DRY.
# and Ruby is pretty close to bash in syntax. Or it's close to Perl, which is close to Bash
# and Python feels like a bunch of boilerplate here
require 'optparse'