Skip to content

Instantly share code, notes, and snippets.

View line-o's full-sized avatar
🌱
weeding the garden

Juri Leino line-o

🌱
weeding the garden
View GitHub Profile
@line-o
line-o / chmod-recursive.xq
Last active November 20, 2022 06:06 — forked from joewiz/chmod-recursive.xq
[WIP] change user, group, mode on resources and collections in eXist-db recursively
xquery version "3.1";
import module namespace sm="http://exist-db.org/xquery/securitymanager";
import module namespace xmldb="http://exist-db.org/xquery/xmldb";
(: these variables need to be set by the caller :)
declare variable $collection as xs:string external;
declare variable $group as xs:string? external;
declare variable $user as xs:string? external;
declare variable $mode as xs:string external;
@line-o
line-o / fib-exist.xq
Last active October 12, 2020 14:45 — forked from joewiz/fib-exist.xq
XQuery Fibonacci reducer function, with timing, for eXist-db
xquery version "3.1";
(: adapted from https://stackoverflow.com/a/4936099 :)
declare function local:fib-reducer ($r, $n) { $r[1] + $r[2], $r[1] };
declare function local:fib($n as xs:integer) {
fold-left((1 to $n), (0,1), local:fib-reducer#2)[1]
};
let $results :=
@line-o
line-o / index.html
Last active August 29, 2015 14:15 — forked from jrideout/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>dc.js multi-line chart attempt</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/dc/1.7.3/dc.css"/>
</head>
@line-o
line-o / index.html
Last active August 29, 2015 14:15 — forked from jsundram/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>dc.js multi-line chart attempt</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/dc/1.7.3/dc.css"/>
</head>
@line-o
line-o / SandBox.js
Created October 8, 2012 14:30 — forked from aemkei/SandBox.js
Is it possible to sandbox JS code
function sandbox(script, context){
context.window = {};
for (var key in context){
context.window[key] = context[key];
}
context.global = context.window;
eval("with (context){ " + script + " }");
}
@line-o
line-o / bt-search.coffee
Created January 27, 2012 09:17 — forked from usefulthink/bt-search.coffee
backtracking combinator
# searches a combination of the given elements that matches toMatch
# @param c array - initially empty, carries the current combination throught
# the recursion
# @param els array - the predefined set of elements
# @param toMatch string - the rest-string to be matched with the elements
#
# @return an array of combinations that recursively match
searchCombination = (c, els, rest) ->
return c if rest.length==0
@line-o
line-o / fi.json
Created August 30, 2011 09:29 — forked from cramforce/de.json
lang.json
{
"locale": "fi",
"text": {
"#authors": [
{
"name": "Juri Leino",
"screen-name": "line-o"
}
],
"tweet": {