This file contains 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"; | |
module namespace dtp-utils = 'http://46.28.111.241:8081/exist/db/apps/karolinum-x/modules/dtp-utils'; | |
import module namespace cust-utils = 'http://46.28.111.241:8081/exist/db/apps/karolinum-x/modules/cust-utils' at 'cust-utils.xqm'; | |
declare namespace tei = 'http://www.tei-c.org/ns/1.0'; | |
(:~ This module is useful for in-memory converting of TEI Simpe XML into XML suitable | |
: for importing into InDesign. It is not a silver bullet, it was tested and developed | |
: for a very specific scenario. However, it should be useful for anyone who uses TEI | |
: Simple XML (possibly with minor modifications of replacing strings and so on) and |
This file contains 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
Application.prototype.main = function(){ | |
if (this.documents.length <= 0) return; | |
var tg = this.selection[0] || this.activeDocument; | |
if ('appliedFont' in tg) tg = tg.parent; | |
if (tg.constructor == TextFrame) { tg = tg.parentStory; } | |
if (!('findGrep' in tg)) return; | |
/* Here it is neecessary to choose a pattern for wrapping the note, we are not parsing | |
here, hence the rough technique! */ | |
var fnPatterns = ["@foot_beg@([\\s\\S]*?)@foot_end@", "@footnote_begin@([\\s\\S]*?)@footnote_end@"]; |
This file contains 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"; | |
module namespace cust-utils = 'http://46.28.111.241:8081/exist/db/apps/karolinum-x/modules/cust-utils'; | |
(: Replace Spaces Soft – This function replaces all spaces after Czech single-letter prepositions | |
: with no-breaking spaces. Done in-memory, without storaging the result in the DB. | |
: The limitation is it does not solve double occurence, e.g. “V hlavě a v těle.“. :) | |
declare function cust-utils:replace-spaces-soft($nodes as node()*) as item()* { | |
let $match := '(^|\s| )([szkvaiouSZKVAIOU])[\s]' | |
for $node in $nodes |
This file contains 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
<!-- Factorial calculated with XSLT recursion. --> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
version="1.0"> | |
<xsl:output method="text"/> | |
<xsl:param name="number" select="9"/> | |
<xsl:template match="/"> | |
<xsl:call-template name="factorial"> |
This file contains 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
<?xmlversion='1.0'?> | |
<xsl:stylesheet | |
xmlns:xsl='http://www.w3.org/1999/XSL/Transform' | |
xmlns:w='http://schemas.openxmlformats.org/wordprocessingml/2006/main' | |
version='1.0'> | |
<xsl:template match="w:document/w:body/w:p/w:r/w:t[node()='Hello World']"> | |
<w:t>Goodbye World</w:t> | |
</xsl:template> | |
<!-- The following transform is the identity transform --> | |
<xsl:templatematch="/|@*|node()"> |
This file contains 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
// newBot.js | |
/* ##################### MODULES ####################### */ | |
let fetch = require( 'node-fetch' ); | |
let fs = require( 'fs' ); | |
let crypto = require( 'crypto' ); | |
let querystring = require( 'querystring' ); | |
/* ##################### CONSTANTS ####################### */ | |
const KEY = ''; |
This file contains 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
// imageValidator.js | |
'use-strict'; | |
function handleFileSelect(evt) { | |
let files = evt.target.files; // FileList object | |
// Loop through the FileList and render image files as thumbnails. | |
for (let i = 0; i < files.length; i++) { |
This file contains 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
let g:airline#themes#seoul256#palette = {} | |
function! airline#themes#seoul256#refresh() | |
let M0 = airline#themes#get_highlight('Special') | |
let accents_group = airline#themes#get_highlight('Special') | |
let modified_group = [M0[0], '', M0[2], '', ''] | |
let warning_group = airline#themes#get_highlight2(['airline_warning', 'bg'], ['airline_warning', 'fg']) | |
let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['StatusLine', 'fg']) |
This file contains 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 | |
use Symfony\Component\Console\Command\Command; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\ConsoleOutputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
/** | |
* Testcase: app/console foo > std 2> err | |
*/ |
OlderNewer