Skip to content

Instantly share code, notes, and snippets.

View joewiz's full-sized avatar

Joe Wicentowski joewiz

  • Arlington, Virginia
View GitHub Profile
@adamretter
adamretter / anon-recursion.xqy
Created September 18, 2015 14:01
Anonymous function recursion in XQuery
xquery version "3.0";
(:~
: Anonymous function recursion in XQuery
:
: @author Adam Retter <[email protected]>
:)
let $factorialHelper := function($f, $x) {
if($x eq 0) then
@CliffordAnderson
CliffordAnderson / books.csv
Last active May 26, 2020 16:32
Some books
Author Title ISBN Binding Year Published
Jeannette Walls The Glass Castle 074324754X Paperback 2006
James Surowiecki The Wisdom of Crowds 9780385503860 Paperback 2005
Lawrence Lessig The Future of Ideas 9780375505782 Paperback 2002
Larry Bossidy, Ram Charan, Charles Burck Execution 9780609610572 Hardcover 2002
Kurt Vonnegut Slaughterhouse-Five 9780791059258 Paperback 1999
Haruki Murakami After the Quake 9780375413902 Paperback 2003
Nassim Nicholas Taleb Fooled by Randomness 9781587991905 Paperback 2005
Robert A. Dahl On Democracy (Yale Nota Bene) 9780300194463 Paperback 2000
Daniel Defoe A Journal of the Plague Year 9780140430158 Paperback 2001
@ryansb
ryansb / check_ssl_expiry.py
Created January 7, 2016 22:53
Check expiring certificates
import datetime
import logging
import socket
import ssl
YOUR_DOMAIN = 'serverlesscode.com'
WARNING_BUFFER = 14
logger = logging.getLogger()
logger.setLevel(logging.INFO)
//
// Phoneme.swift
import Foundation
class Phoneme {
private var isAVowelPhoneme = false;
private var phoneme = "";
@aschweer
aschweer / pre-commit
Created February 14, 2016 20:14
git pre-commit hook to check XML files for well-formedness, using 'file' and 'xmllint' commands
#!/bin/bash
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
@glueckpress
glueckpress / GitHub-Desktop-Bitbucket.md
Last active February 6, 2025 13:18
[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.
@wilhelmy
wilhelmy / dirlist.xslt
Last active July 1, 2025 04:00
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 <[email protected]>
@CliffordAnderson
CliffordAnderson / simple-dpla-with-params-xml.xqy
Last active March 21, 2016 13:41
Just a quick example of searching the DPLA API using XQuery and returning a simple webpage.
module namespace page = 'http://library.vanderbilt.edu/dpla';
(: Just a quick example of searching the DPLA API
and returning a simple webpage. :)
declare
%rest:path("dpla/{$search}")
%rest:query-param("key", "{$key}")
%output:method("html")
function page:html($search as xs:string, $key as xs:string)
@timathom
timathom / basex-async.xq
Last active March 21, 2016 13:41
Anonymous inline function with asynchronous evaluation in BaseX
(:~
: Anonymous inline function with asynchronous evaluation in BaseX 8.4.1 beta
:
: @param $query Asynchronously evaluated query
: @return XQuery expression, followed by result of async HTTP request.
:
: BaseX Async Module:
: http://docs.basex.org/wiki/Async_Module
:
: Dimitre Novatchev on recursion with anonymous inline functions in XPath 3.0:
@grantmacken
grantmacken / muURL.xqm
Last active June 5, 2024 22:33
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