Skip to content

Various pieces of code I've written, in case someone else finds them useful.

Notifications You must be signed in to change notification settings

sfc-gh-cmilton/useful-snippets

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@EricFromCanada’s Byte Bucket

AppleScript

arrange windows
Arranges windows for specified applications across two screens, because application windows don't preserve their positions on an external display if it's unplugged or sleeps (unless "Displays have separate Spaces" is enabled). More info here.
close Safari Web Inspector
Before Safari 6, the Web Inspector shortcut would only open it. Attach this AppleScript to another shortcut to make it closable.
HTMLize Selected Text
Runs selected text through Markdown.pl and SmartyPants.pl, and converts any MacRoman non-ASCII characters to HTML entities. (A relic from before UTF-8 was the standard online.)
Journler2Blogger
Uses the logic from HTMLize Selected Text to prepare a Journler entry for submission to Blogger. Includes the ability to convert rich text styles to HTML.

bash

keyputter.sh
Handy if you have a bunch of servers you need to install your SSH key onto and don't have ssh-copy-id.
svn-user-htdigest.sh
Use this to generate an htdigest file of users from an svnserve passwd file. Useful if you have a Trac installation using HTTPAuth and you need to grant your SVN users access.
Time-Machine-NASifier.command
Creates a Time Machine bundle for the current Mac with larger 128MB band files (up from 8MB) to improve performance when backing up to a NAS over AFP or SMB.

BBEdit

reStructuredText codeless language module
Language module for BBEdit and TextWrangler which highlights elements in reStructuredText files and lists section titles in the function pop-up menu. Recognizes both standard reST directives and Sphinx additions. See its comments for my recommended editor settings.
Lasso codeless language module
Language module for BBEdit and TextWrangler which adds both Lasso 8- and 9-style type and function names to the function menu, and highlights elements not supported by the current BBEdit language module such as ticked strings, tag literals, and variables.
Liquid codeless language module
Language module for BBEdit and TextWrangler which highlights only markup between Liquid delimiters, marking everything else as comments. Supports keywords added in Liquid 5.0.0.
Apache 2.4 Configuration codeless language module
Update of John Gruber's Apache Configuration Language Module to include variables, Apache 2.4 keywords, and some bugfixes.
Make 4.3 codeless language module
Update of BBEdit's / TextWrangler's built-in module to include more keywords from GNU make. These changes have been integrated into BBEdit as of version 13.5.5.

All these are also listed among the language modules at BBEdit Extras.

JavaScript

touch-menus-plus.js
Makes navigation links with drop-down menus usable on iOS by only enabling the link if its submenu is visible. This is only required if JavaScript is used to hide and show submenus, since iOS accounts for CSS-based menus by preventing a :hover region's links from activating until any divs it'll reveal are displayed.
Lasso lexer for highlight.js
Contributed a lexer for the Lasso programming language for highlight.js, a JS-based syntax highlighter. Included since version 7.4.
Lasso lexer for code-prettify
Also wrote a Lasso lexer for code-prettify, another JS-based syntax highlighter.

Lasso

completions-generator.lasso
Script which generates a CodaCompletion.plist file for the Coda 2 Lasso mode.
sphinxifier.lasso
Script for generating API documentation for Sphinx directly from Lasso code.

Python

Lasso domain for Sphinx
Domain plugin for the Sphinx documentation processor, allowing it to handle descriptions of Lasso syntax.
Lasso lexer for Pygments
Contributed a lexer for the Lasso programming language for the Pygments syntax highlighter. Included since version 1.6.
restview
Contributed CSS, syntax highlighting, and request handling improvements to restview, a tool for previewing reST documents in a web browser.

Ruby

Homebrew
Numerous contributions to Homebrew's commands, documentation, messaging, and online package browser.
Lasso lexer for Rouge
Contributed a lexer for the Lasso programming language for the Rouge syntax highlighter. Included since version 2.0.8.

More about me and things I've written.

About

Various pieces of code I've written, in case someone else finds them useful.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • AppleScript 55.3%
  • Lasso 22.6%
  • Shell 17.9%
  • Python 2.3%
  • JavaScript 1.9%