Skip to content

Instantly share code, notes, and snippets.

View fgeorges's full-sized avatar

Florent Georges fgeorges

View GitHub Profile
@fgeorges
fgeorges / fomantic-dropdown-search-uris.html
Last active November 1, 2020 14:56
Weird results when searching in a Fomantic dropdown
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.8.7/dist/semantic.min.css">
<script src="https://cdn.jsdelivr.net/npm/fomantic-ui@2.8.7/dist/semantic.min.js"></script>
<style>
.container {
padding: 5em 0em;
}
.ui.dropdown {
@fgeorges
fgeorges / README.md
Last active August 9, 2023 09:07
Graph with expandable nodes, with D3

Note: A solution has been found, see below.

I am trying to create an SVG graph of nodes with D3, with "expandable nodes." That is, when one clicks on a node, its siblings are added to the graph (or more precisely: its siblings in the graph data are added to the graph visualization.)

The visualization uses a d3 force simulation (using D3 v5). When a node (an SVG circle) is clicked, the simulation is stopped (in case it was still running, to make sure there is no new node with no coordinates added in the middle of a run,) the corresponding nodes and links are added to the corresponding arrays,

@fgeorges
fgeorges / recursive-descent-copy.xquery
Created December 15, 2018 18:09
XQuery recursive descent copy
(:~
: Template for the recursive descent copy.
:
: This function does not actually modify anything as such. Modify it as needed,
: this version does by default, for each node, a recursive exact same copy.
:
: Note that in addition to typeswitch cases, you can also have regular if/else
: statements, for more complex conditions, but conditions that can be expressed
: as typeswitch cases will be more efficient.
:)
@fgeorges
fgeorges / README.md
Last active July 19, 2016 06:36
Book icon in Markdown

Intro

  • icon Ⓖ
  • super icon
  • title
  • icon ⧗
  • super icon
  • title
  • icon ⛿
  • super icon
@fgeorges
fgeorges / 01-repro.xquery
Last active March 30, 2016 10:35
XQuery parser stack overflow
import module namespace p = "XQueryML30"
at "XQueryML30.xquery";
declare variable $src :=
'
(:~
: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean
: mauris ante, commodo sed ipsum et, malesuada blandit neque. Nulla
: nulla neque, malesuada quis dignissim in, hendrerit non
: lorem. Vestibulum in diam venenatis, semper lectus vel, finibus
@fgeorges
fgeorges / log-excerpt.txt
Created February 21, 2016 13:50
Add a trigger with MarkLogic
Log excerpt after creation of a new document "/test/hello-world.xml":
2015-10-29 16:18:39.687 Info: expath-console: ***** Document /test/hello-world.xml was created. *****
2015-10-29 16:18:39.687 Info: expath-console: <?xml version="1.0" encoding="UTF-8"?>
2015-10-29 16:18:39.687 Info: expath-console: <hello>World!</hello>
2015-10-29 16:18:39.687 Info: expath-console: *****
#!/usr/local/bin/phantomjs
var page = require('webpage').create();
var system = require('system');
// ***** Argument handling
function isInt(value) {
return !isNaN(value) &&
parseInt(Number(value)) == value &&
<?xml version="1.0" encoding="UTF-8"?>
<xxx xmlns:p1="uri2">
<a/>
</xxx>