Skip to content

Instantly share code, notes, and snippets.

View davidbgk's full-sized avatar
Let’s escape GAFAM+ when/while we can!

David Larlet davidbgk

Let’s escape GAFAM+ when/while we can!
View GitHub Profile
* cloneNode(true), but also clones shadow roots.
* @param {Element}
* @param {ShadowRoot[]} [shadowRoots] Any closed shadow roots passed here will be included.
function cloneWithShadowRoots(node, shadowRoots) {
function walk(node, clone) {
let shadow = node.shadowRoot || shadowRoots.find(r => === node);
if (shadow) {
clone.attachShadow({ mode: shadow.mode }).append(...[], c => c.cloneNode(true)));
davidbgk /
Created April 11, 2017 15:39
An attempt to create the simplest HTTP Hello world in Python3
import http.server
import socketserver
from http import HTTPStatus
class Handler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
self.wfile.write(b'Hello world')


Merci Agnès Crepet. Motivé pour être ici. Discussion sur mode de vie post Mix-it, 2h du mat’ en partant.

Nomadisme , connu?

"@context": {
"@vocab": "",
"dp": "",
"schema": "",
"rdfs": "",
"xsd": "",
"url": "@id",
"linked_portals": {
thom4parisot / Gulpfile.js
Last active September 22, 2020 11:43
gulp -> npm scripts only
'use strict';
var pkg = require('./package.json');
var gulp = require('gulp');
var utils = require('gulp-util');
var source = require('vinyl-source-stream');
var isWatching = false;
var isProduction = process.env.NODE_ENV === 'production';
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
NodeList.prototype.__proto__ = Array.prototype;
0gust1 / gist:260638bd34a434e7f3dd
Last active September 16, 2023 16:49
Footnotes to sidenote, and maybe links to sidenotes ?
* Generate sidenotes using footnotes from Multimarkdown generated content
* Idea and principle borrowed from Adrew Clark : and
* This script : - gather footnotes in the passed container selector
* - insert the sidenotes in the current text, according to screen size :
* - on big screens insert the sidenote *before* the anchor
* - on medium screens, insert the sidenote *after* the anchor
davidbgk / index.html
Created December 10, 2014 20:21
Correction mise en situation du cours de HTML/CSS/JS pour l'IUT d'Arles
<!DOCTYPE html>
<html lang="fr">
<meta charset="utf-8">
<title>Club de lecture — Lettres persanes</title>
<link rel="stylesheet" href="main.css">
<body class="cleartheme"><!-- par défaut le thème est clair -->
<div class="main"><!-- pour centrer le site -->
karlcow /
Last active August 29, 2015 14:07
ParisWeb 2015 - Talk ideas

ParisWeb 2015 - Talk ideas

What are the things that could be addressed at Paris Web 2015? 10th anniversary. I will add little by little what comes to my mind.

How To Contact Web sites?

Sometimes sites are broken. There is for helping to record, but what are the techniques for finding the right contacts? Learn how to find contacts on Web site. What is working, not working, maximize the chances to get the issue fixed. It's not 100% bullets proof, but it helps a lot to be more effective.


gruber / Liberal Regex Pattern for Web URLs
Last active April 22, 2024 19:02
Liberal, Accurate Regex Pattern for Matching Web URLs
The regex patterns in this gist are intended only to match web URLs -- http,
https, and naked domains like "". For a pattern that attempts to
match all URLs, regardless of protocol, see:
# Single-line version: