This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var test = require('tape'); | |
var Nightmare = require('nightmare'); | |
var properties = require('properties-parser').read('./config'); | |
var website = 'http://' + properties.NAME | |
test('example tap test using nightmare and tape', function (t) { | |
t.plan(1); | |
new Nightmare() | |
.goto(website) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var test = require('tape'); | |
// var driver = require('node-phantom-simple'); | |
var properties = require('properties-parser').read('./config'); | |
var website = 'http://' + properties.NAME | |
var phridge = require("phridge"); | |
test('example tap test using phridge and tape', function (t) { | |
t.plan(1); | |
phridge.spawn().then(function(phantom) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var test = require('tape'); | |
var phantom = require('phantom'); | |
var properties = require('properties-parser').read('./config'); | |
var website = 'http://' + properties.NAME | |
test('example tap test using phantom and tape', function (t) { | |
t.plan(2); | |
phantom.create(function (ph) { | |
ph.createPage(function (page) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# makes a shell call to node and uses cheerio to extract mimetype from | |
# passed in file name | |
# depends on cheerio node_module in reachable node path | |
getMimeType = $(shell node -pe "\ | |
fs = require('fs');\ | |
re = /$1/;\ | |
n = require('cheerio').load(fs.readFileSync('$(EXIST_HOME)/mime-types.xml'),\ | |
{ normalizeWhitespace: true, xmlMode: true});\ | |
n('extensions').filter(function(i, el){\ | |
return re.test(n(this).text());\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.0"; | |
declare variable $exist:path external; | |
declare variable $exist:resource external; | |
declare variable $exist:controller external; | |
declare variable $exist:prefix external; | |
declare variable $exist:root external; | |
import module namespace xmldb="http://exist-db.org/xquery/xmldb"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
ISSUE_DATE=2015-01-14 | |
ISSUE_LABEL="enhancement" | |
ISSUE_TITLE="branch selection from issue" | |
ISSUE_STATE="open" | |
ISSUE_NUMBER=2 | |
--- | |
A one line *summary* of what we hope to resolve. | |
- [x] todo task 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash +x | |
function reposCreateNewRepo(){ | |
local apiUrlBase='https://api.github.com' | |
GITHUB_ACCESS_TOKEN=$( cat ${GITHUB_ACCESS_TOKEN_LOCATION} ) | |
PROJECT_NAME=$( echo ${PWD##*/} ) | |
PROJECT_DESCRIPTION="website project ${PROJECT_NAME}" | |
local chkGitStatus=$( git status 2>/dev/null ) | |
echo "CHECK! if ${PROJECT_NAME} under git control" | |
if [[ -n ${chkGitStatus} ]] ; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.0"; | |
(:~ | |
We want LIVE browser preview testing of tests found in the tests collection | |
when we are working on an xquery library module | |
gistID: 61082e441e43653b8b75 | |
https://gist.github.com/grantmacken/61082e441e43653b8b75 | |
I use this with a Komodo toolbox macro which on save | |
uploads working file to existdb localhost server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
%test:args('<a class="h-entry" href="http://microformats.org/2012/06/25/microformats-org-at-7">microformats.org at 7</a>') | |
%test:assertExists | |
%test:assertTrue | |
%test:assertXPath("count($result) = 1") | |
%test:assertXPath("local-name($result[1]) eq 'entry'") | |
%test:assertXPath(" 'name' = ( map(function($n) { local-name($n) }, $result[1]/*) ) ") | |
%test:assertXPath(" 'url' = ( map(function($n) { local-name($n) }, $result[1]/*) ) ") | |
function st:just-a-hyperlink($node as element()) as element() { | |
mf2:dispatch($node) |