Skip to content

Instantly share code, notes, and snippets.

View amclark42's full-sized avatar

Ash Clark amclark42

View GitHub Profile
@vincentml
vincentml / formatter.xsl
Created August 4, 2023 17:12
XML Formatter
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
xmlns:this="formatter"
exclude-result-prefixes="xs xd this"
expand-text="true"
version="3.0">
<xd:doc scope="stylesheet">
<xd:desc>
@stephanieleary
stephanieleary / instafic-base.css
Last active January 15, 2024 16:22
Instafic skins for AO3: large font + limited line length for readability, based on Readability (RIP) and Instapaper. Includes white, cream, and dark modes.
/* TO USE: Add this as a site skin. This is the base for the other two color schemes.
You may use this as the preview image for the basic (white background) skin: https://www.dropbox.com/s/iutrts8fawidn0d/ao3skin-instafic-gentle-antidote.jpeg?dl=0
/**/
.listbox blockquote,
.listbox pre {
font-family: Georgia, serif;
font-size: 1.15em;
line-height: 1.4;

Always Already Programming

Everyone who interacts with computers has in important ways always already been programming them.

Every time you make a folder or rename a file on your computer, the actions you take through moving your mouse and clicking on buttons, translate into text-based commands or scripts which eventually translate into binary.

Why are the common conceptions of programmer and user so divorced from each other? The distinction between programmer and user is reinforced and maintained by a tech industry that benefits from a population rendered computationally passive. If we accept and adopt the role of less agency, we then make it harder for ourselves to come into more agency.

We've unpacked the "user" a little, now let's look at the "programmer." When a programmer is writing javascript, they are using prewritten, packaged functions and variables in order to carry out the actions they want their code to do. In this way, the programmer is also the user. Why is using pre-made scripts seen

@joewiz
joewiz / yaml-to-xml.xq
Created August 22, 2016 21:55
Convert YAML to XML, with XQuery
xquery version "3.0";
(: doesn't support YAML indentation yet - just a start :)
declare function local:process-yaml-value($value) {
let $single-quote := "^'(.+)'$"
let $double-quote := '^"(.+)"$'
return
if (matches($value, $single-quote) or matches($value, $double-quote)) then
let $pattern := "^['""](.+)['""]$"
@joewiz
joewiz / exist-xpath-functions.xq
Last active April 1, 2020 15:18
Compare XPath functions in W3C spec vs. eXist 3.4.0
xquery version "3.1";
element modules {
util:registered-modules()[starts-with(., 'http://www.w3')] !
element module {
element namespace-uri {.},
util:registered-functions(.) !
element function {.}
}
}
@joewiz
joewiz / json-xml.xqm
Last active June 6, 2021 00:33
An implementation of XQuery 3.1's fn:json-to-xml and fn:xml-to-json functions for eXist
xquery version "3.1";
(:~
: An implementation of XQuery 3.1's fn:json-to-xml and fn:xml-to-json functions for eXist, which does not support them natively as of 4.3.0.
:
: @author Joe Wicentowski
: @version 0.4
: @see http://www.w3.org/TR/xpath-functions-31/#json
:)
module namespace jx = "http://joewiz.org/ns/xquery/json-xml";
@wsalesky
wsalesky / git-sync.xql
Last active August 19, 2019 08:58
Sync remote eXistdb with github repository automatically using github webhooks.
xquery version "3.0";
(:module namespace gitsync = "http://syriaca.org/ns/gitsync";:)
(:~
: XQuery endpoint to respond to Github webhook requests. Query responds only to push requests.

: The EXPath Crypto library supplies the HMAC-SHA1 algorithm for matching Github secret. 

:
: Secret can be stored as environmental variable.
: Will need to be run with administrative privileges, suggest creating a git user with privileges only to relevant app.