Skip to content

Instantly share code, notes, and snippets.

View joewiz's full-sized avatar

Joe Wicentowski joewiz

  • Arlington, Virginia
View GitHub Profile
@lisamelton
lisamelton / transcode-video.sh
Last active September 8, 2023 23:51
Transcode video file (works best with Blu-ray or DVD rip) into MP4 (or optionally Matroska) format, with configuration and at bitrate similar to popular online downloads.
#!/bin/bash
#
# transcode-video.sh
#
# Copyright (c) 2013-2015 Don Melton
#
about() {
cat <<EOF
$program 5.13 of April 8, 2015
@glueckpress
glueckpress / GitHub-Desktop-Bitbucket.md
Last active June 20, 2023 08:16
[How-to] Use GitHub Desktop to clone and commit to a Bitbucket repository just as you would with any GitHub repository. (Mac)

⚠️ Note: this guide is from 2016 – a long time on the internet. Content may be outdated, check the comments for more recent info.


Clone Bitbucket Repository and Add it to GitHub Desktop App (Mac)

You can’t clone a Bitbucket repo using GithHub Desktop directly. Instead you would have to:

  1. Clone the Bitbucket repo locally via command line.
  2. Add the cloned repository to your GitHub Desktop app.
@line-o
line-o / latest-news.html
Last active June 19, 2023 14:53
Prerender HTML with eXist-db's templating library
<main class="news-list__latest">
<ul>
<li data-template="templates:each" data-template-from="articles" data-template-to="article">
<a data-template="pr:article-link"/>
</li>
</ul>
</main>
@wilhelmy
wilhelmy / dirlist.xslt
Last active June 5, 2023 10:44
make nginx dirlistings look like lighttpd's through the magic of xslt-transforming xml dirlistings. I don't even.
<?xml version="1.0"?>
<!--
dirlist.xslt - transform nginx's into lighttpd look-alike dirlistings
I'm currently switching over completely from lighttpd to nginx. If you come
up with a prettier stylesheet or other improvements, please tell me :)
-->
<!--
Copyright (c) 2016 by Moritz Wilhelmy <mw@barfooze.de>
@grantmacken
grantmacken / muURL.xqm
Last active March 8, 2023 00:13
xQuery helper functions for dealing with URLs
xquery version "3.0";
(:~
This module contains helper functions for dealing with URLs.
When receiving webmention the post parameter 'source' is a URL pointing to the
origin of the mention.
Before we get and store a sanitized version of an HTML document the url links to
we want to able to
@adamretter
adamretter / xdm-type.xqm
Last active January 7, 2023 06:22
xdm-type.xqm
declare function local:xdm-type($value as item()?) as xs:QName? {
typeswitch($value)
case array(*) return xs:QName("array")
case map(*) return xs:QName("map")
case function(*) return xs:QName("function")
case document-node() return xs:QName("document")
case element() return xs:QName("element")
case attribute() return xs:QName("attribute")
case comment() return xs:QName("comment")
case processing-instruction() return xs:QName("processing-instruction")
@drdrang
drdrang / smarten.js
Created November 18, 2010 14:51
A very simple quote and dash smartener in JS. Used to make my tweets look nicer.
// Change straight quotes to curly and double hyphens to em-dashes.
function smarten(a) {
a = a.replace(/(^|[-\u2014/(\[{"\s])'/g, "$1\u2018"); // opening singles
a = a.replace(/'/g, "\u2019"); // closing singles & apostrophes
a = a.replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1\u201c"); // opening doubles
a = a.replace(/"/g, "\u201d"); // closing doubles
a = a.replace(/--/g, "\u2014"); // em-dashes
return a
};
@RobTrew
RobTrew / ParseAllOPMLAttributes.js
Last active December 8, 2022 23:02
PARSE LOCAL OPML FILE IN OS X 10.10 JXA USING $.NSXMLDocument (parsing 'text' + all other attributes)
// PARSE LOCAL OPML FILE IN OS X 10.10 JXA USING $.NSXMLDocument
// Ver 2.0 Parse all attributes (ver 1 just parsed text)
function run() {
var app = Application.currentApplication();
app.includeStandardAdditions = true;
function readTextFromFile(strPath) {
return $.NSString.stringWithContentsOfFile(strPath);
}
# Thanks to this post:
# http://blog.ikato.com/post/15675823000/how-to-install-consolas-font-on-mac-os-x
$ brew install cabextract
$ cd ~/Downloads
$ mkdir consolas
$ cd consolas
$ curl -O http://download.microsoft.com/download/f/5/a/f5a3df76-d856-4a61-a6bd-722f52a5be26/PowerPointViewer.exe
$ cabextract PowerPointViewer.exe
$ cabextract ppviewer.cab
@gimsieke
gimsieke / invocation.sh
Created September 18, 2022 16:28
REx EBNF for a parsing problem presented by Martynas Jusevičius on the xml.com slack
# Go to https://bottlecaps.de/rex/ and use this command line on nested-parentheses.ebnf: -xslt -main -tree -ll 3 -backtrack
# Assumption: A Saxon front-end script called 'saxon' is on the path
saxon -o:out.xml -it:main -xsl:nested-parentheses.xslt input='{(((40 40, 20 45, 45 30, 40 40)), ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35), (30 20, 20 15, 20 25, 30 20)))}' '!indent=yes'
# Looking at the main template of the generated XSLT, you need to surround the input string with curly braces; otherweise it will be interpreted as a file name