Skip to content

Instantly share code, notes, and snippets.

(╯°□°)╯︵ ┻━┻

David Larlet davidbgk

(╯°□°)╯︵ ┻━┻
Block or report user

Report or block davidbgk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
davidbgk / index.html
Last active Dec 30, 2019
Upload images form with drag & drop and previews and progress upload
View index.html
<!doctype html><!-- This is a valid HTML5 document. -->
<!-- Screen readers, SEO, extensions and so on. -->
<html lang=fr>
<!-- Has to be within the first 1024 bytes, hence before the <title>
See: -->
<meta charset=utf-8>
<!-- Why no `X-UA-Compatible` meta: -->
<!-- The viewport meta is quite crowded and we are responsible for that.
See: -->
<meta name=viewport content="width=device-width,minimum-scale=1,initial-scale=1,shrink-to-fit=no">
davidbgk / setup.cfg
Created Dec 17, 2019 — forked from althonos/setup.cfg
A `setup.cfg` template for my Python projects
View setup.cfg
name = {name}
version = {version}
author = Martin Larralde
author-email =
home-page ={name}
description = {description}
long-description = file: README.rst, CHANGELOG.rst
davidbgk /
Created Nov 8, 2018 — forked from CMCDragonkai/
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

davidbgk / nginx.conf
Created May 3, 2018
nginx conf to proxy carto tiles
View nginx.conf
proxy_cache_path /srv/user/cache levels=1:2 keys_zone=tiles-cache:8m max_size=500000m inactive=1000d;
proxy_temp_path /srv/user/cache/tmp;
upstream openaip_backend {
upstream cartodb_backend {
davidbgk / stimulus.html
Last active Mar 27, 2018
Playing with Stimulus tutorial
View stimulus.html
<!doctype html>
<meta charset=utf-8>
<title>Hello Stimulus</title>
<script src=""></script>
window.addEventListener('DOMContentLoaded', _ => {
const application = Stimulus.Application.start()
application.register('hello', class extends Stimulus.Controller {
static get targets () {
View beautiful-html5-dialog.css
dialog {
position: fixed;
top: 50%;
left: 50%;
right: auto;
padding: 30px;
transform: perspective(500px) translate(-50%, -50%);
background: linear-gradient(to bottom, #FFF, #F4F4F4) #FFF;
border: none;
border-radius: 3px;
davidbgk /
Created Jun 22, 2017
Statistiques autour des données datagouv compilées pendant la Workweek

Stats Datagouv

Au 2017-06-20, il y a 65535 resources et 24699 datasets.

Il y a 52618 ressources de type file, 17642 de type remote et 409 de type api.

Il y a 37847 ressources inspire + geo-ide récupérées via la passerelle Inspire sur les 65535 resources disponibles (soit 58%) qui sont indiquées comme étant de type file alors qu’elles sont remote.

Il y a donc 14771 ressources locales de type file auxquelles il faut enlever les anciennes ressources (v1 de datagouv) qui dupliquaient les données distantes ainsi que les données publiées via l’API sans préciser le type (file est le type attribué par défaut (?)).

davidbgk / index.html
Last active Sep 26, 2017
Dealing with (non)critical CSS, the progressive enhancement way
View index.html
<!doctype html><!-- This is a valid HTML5 document. -->
<meta charset=utf-8><!-- Better(?) to include encoding before the <title>. -->
<title>Test template</title><!-- Required to make a valid HTML5 document. -->
<link rel=icon href="data:;base64,iVBORw0KGgo="><!-- Blank gif, avoids an extra query. -->
/* Critical CSS only: above the fold, positionning and so on. */
p { background-color: red; }
<!-- Preload the not critical CSS for future usage. -->
<link rel=preload href=not-critical.css as=style onload="this.rel='stylesheet'">
davidbgk / index.html
Last active May 8, 2017
Test with SkateJS and Firefox 53
View index.html
<!doctype html>
<meta charset=utf-8>
<title>Test skatejs</title>
<link rel=icon href="data:;base64,iVBORw0KGgo=">
<script src=></script>
<script src=></script>
const { skate } = window
class Hello extends skate.Component {
static get is () {
davidbgk /
Created Apr 11, 2017
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')
You can’t perform that action at this time.