Skip to content

Instantly share code, notes, and snippets.

View emchateau's full-sized avatar

Emmanuel Château-Dutier emchateau

View GitHub Profile
@emchateau
emchateau / gist:dd016198087400f5b086003310bbac7d
Created November 9, 2023 21:37
Les transformations de Paris sous Haussmann
# Les transformations de Paris sous Haussmann
legende: "Pierre Petit (1831-1909). [Eugène] Haussmann. [Recueil. Les Conseillers de la Commission municipale de Paris et de la Commission départementale de la Seine] 1860."
technique: "Tirage au charbon d’après un négatif sur verre, 46,5 cm (page)."
url: https://gallica.bnf.fr/ark:/12148/btv1b8447739m/f7.item
iiif: https://gallica.bnf.fr/view3if/ga/ark:/12148/btv1b8447739m/f7
legende: "Henri de Montaut Hubert Clerget. Le Baron Haussmann. Le journal illustré, n°228, 5e année, du 21 au 28 juin 1868."
technique: "Photo, RMN-Grand Palais (domaine de Compiègne) / image Compiègne"
url: http://palaisdecompiegne.fr/
@emchateau
emchateau / getWordCount.xq
Created March 1, 2023 12:42
getWordsCount
(:~
: If performance is a concern, this problem is much better suited to leverage a word index with frequency data, like in an XML database. Solving this in pure XQuery may be considerably slower for large XML but solves the problem
: https://stackoverflow.com/questions/15122641/count-number-of-word-occurrences-in-strings-using-xquery
:)
let $xml :=
<root>
<nodeOne>
<nodeTwo>
<nodeThree>
foo bar zoo
@emchateau
emchateau / loadFile.html
Created September 25, 2022 01:39
Load local file with JS
<html>
<body>
<form id="jsonFile" name="jsonFile" enctype="multipart/form-data" method="post">
<fieldset>
<h2>Json File</h2>
<input type='file' id='fileinput'>
<input type='button' id='btnLoad' value='Load' onclick='loadFile();'>
</fieldset>
@emchateau
emchateau / count.xq
Created April 26, 2022 13:57
Quick count
for $group in db:open('xpr')/xpr/expertises/expertise
for $year in $group/description/sessions/
date[@when castable as xs:date]/year-from-date(@when)
group by $year
return $year || ' : ' || count($group/self::node())
(: The self::node() step is used in the last line to remove duplicate nodes in the resulting $group value. :)
@emchateau
emchateau / simpleline.css
Created April 24, 2022 15:13
Longueur de ligne
h1, h2, h3 {
line-height: 1.1;
}
p {
max-width: 60ch
}
@emchateau
emchateau / radio.css
Last active January 23, 2022 14:01
Stylage des radio
/* https://moderncss.dev/pure-css-custom-styled-radio-buttons/ */
:root {
accent-color: mediumvioletred;
}
[type="radio"] {
font-size: inherit;
width: .75em;
height: .75em;
}
@emchateau
emchateau / CR Labouvroir 1er novembre 2021.md
Last active November 1, 2021 22:16
CR Labouvroir 2021-11-01

Pad du Laboratoire Ouvroir

CR Labouvroir 1er novembre 2021

Calendrier

On passe en revue le calendrier des activités et la plannification.

Programmer deux lancements :

  • premier lancement virtuel du site avec conférentier (décembre/janvier)
export const intervenants = [
{
id: "yves-bergeron", // on essaie ici de garder une nomenclature identique pour tous les ids : prenom-nom
firstName: "Yves",
lastName: "Bergeron",
institution: "UQAM Chair for Museum Governance and Cultural Law",
presentation: "Perferentes per obiecta defensi reginae inde quaesitum exsertantis praestituto quid iam truci praedoctis praestituto adhibitis funestis iudex imaginarius interrogationibus die permissi interrogationibus adhibitis iudex imaginarius cursim inde nec quid diluere interrogationibus quidve interrogationibus hinc stimulis quid responsum defensi esset reginae truci per equitum Caesarem ad obiecta Caesarem funestis essent quid.",
intervention: "", // @todo ajouter
sessions: ["conference-ouverture-01"]
},
@emchateau
emchateau / intervenants.js
Last active February 24, 2021 04:28
Fichiers icofom2021
const intervenants = [
{
id: "yves-bergeron", // on essaie ici de garder une nomenclature identique pour tous les ids : prenom-nom
firstName: "Yves",
lastName: "Bergeron",
institution: "Chaire de recherche UQAM sur la gouvernance des musées et le droit de la culture",
presentation: "Perferentes per obiecta defensi reginae inde quaesitum exsertantis praestituto quid iam truci praedoctis praestituto adhibitis funestis iudex imaginarius interrogationibus die permissi interrogationibus adhibitis iudex imaginarius cursim inde nec quid diluere interrogationibus quidve interrogationibus hinc stimulis quid responsum defensi esset reginae truci per equitum Caesarem ad obiecta Caesarem funestis essent quid.",
intervention: "", // @todo ajouter
sessions: []
},
@emchateau
emchateau / deepest.xpath
Created February 19, 2021 21:29
getDeepest
//*[not(*)][count(ancestor::node())
=
max(//*[not(*)]/count(ancestor::node()))
]