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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project default="xar" name="wilde" xmlns:xdb="http://exist-db.org/ant"> | |
| <description>Wilde Trials International News Archive</description> | |
| <property name="host" value="localhost"/> | |
| <property file="${host}.properties"/> | |
| <path id="classpath.core"> | |
| <fileset dir="${local.dir}/lib"> | |
| <include name="*.jar"/> |
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
| ```shell | |
| for u in $(hub api orgs/$ORGNAME/repos | jq '.[].ssh_url' | sed -e 's/"//g'); do echo $u; git clone "$u"; done | |
| ``` |
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
| $nodes = $xp->query('/tei:TEI/tei:text//node()[self::text() or self::tei:pb]'); | |
| for($n = 0; $n < $nodes->length; $n++) { | |
| $node = $nodes->item($n); | |
| if($node instanceof DOMNode && $node->nodeType === XML_ELEMENT_NODE) { | |
| $pageCount++; | |
| $content = preg_replace("/[[:space:]]{2,}/u", ' ', $text) . "\n"; | |
| $fn = sprintf("%s/%s_%04d", $dir, $id, $pageCount); | |
| file_put_contents($fn, $content); | |
| $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
| git submodule deinit -f path/to/submodule | |
| rm -rf .git/modules/path/to/submodule | |
| git rm -f path/to/submodule |
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
| # OS X | |
| sudo lsof -i tcp:3000 | |
| # Older OS X - PID is second to last number. | |
| netstat -vanp tcp | grep 3000 |
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
| set_error_handler(function($number, $msg, $file, $line, $vars){ | |
| print "$msg:$file:$line\n"; | |
| }); |
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
| <?php | |
| foreach(array(true, false, null, 'a') as $a) { | |
| var_dump($a); | |
| switch($a) { | |
| case true: | |
| print "true"; | |
| break; | |
| case null: | |
| print "null"; |
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"; | |
| (: | |
| Sadly, the eXist 2.2 normalize-unicode() function is broken. So we call out | |
| to the java one. | |
| :) | |
| declare namespace normalizer = "java:java.text.Normalizer"; | |
| declare namespace form = "java:java.text.Normalizer$Form"; | |
| declare function local:normalize($string as item()) as xs:string { |
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
| Based heavily on https://gist.github.com/gmcharlt/f7e3bcb3680a5bf748aacd7e21c13175 | |
| ```perl | |
| #!/usr/bin/env perl | |
| use 5.014; | |
| use utf8; | |
| use strict; | |
| use warnings; |
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 namespace xhtml="http://www.w3.org/1999/xhtml"; | |
| let $wc := | |
| for $p in collection('/db/apps/wilde-data/data')//xhtml:p | |
| return count(tokenize($p, '\s')) | |
| return sum($wc) | |
NewerOlder