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 /
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')
davidbgk /
Created Apr 4, 2017 — forked from simonw/
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using and

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
# Instructions:
# 1. Copy this script locally and run the following `chmod +x`
# 2. Later, run the following: `./` and see your MAC address changing.
echo "origin MAC address: " `sudo ifconfig en0 ether | grep ether`
sudo ifconfig en0 ether `openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`
echo "new MAC address: " `sudo ifconfig en0 ether | grep ether`
View es6-feature-detection.js
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' +
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' +
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' +
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));';
try {
} catch(e) {
alert('Your browser does not support ES6!')
davidbgk /
Last active Jul 8, 2019
Given a folder containing CommonMark files, turn it into HTML.



Given a folder containing CommonMark files, turn it into HTML.


File structure

davidbgk /
Created Jan 14, 2017 — forked from anonymous/ template
#!/usr/bin/env python
# coding=utf-8
python distribute file
from __future__ import (absolute_import, division, print_function,
unicode_literals, with_statement)
View sw-precache-config.js
swPrecache.write(path.resolve(__dirname, `../public/service-worker.js`), {
cacheId: `know-it-all`,
filename: `service-worker.js`,
stripPrefix: `public/`,
staticFileGlobs: [
`public/app.*.js`, // don't include the polyfills version
dontCacheBustUrlsMatching: [
/\.(js|json)$/, // I'm cache busting js and json files myself
davidbgk / index.html
Created Dec 1, 2016
Test promisified DCL + class init
View index.html
<!DOCTYPE html>
<meta charset=utf-8>
<title>Test promisified DCL + class init</title>
<script src=test.js></script>
document.ready = new Promise((resolve) =>
document.addEventListener('DOMContentLoaded', resolve))
document.ready.then((event) => new window.Example(
<p>Hello world</p>
davidbgk /
Last active Nov 15, 2016
Bonnes pratiques et fichiers issus de #OpenSirene


1. Nommage

Donner un nom explicite aux fichiers générés :

davidbgk / Preferences.sublime-settings
Created Nov 12, 2016
Current SublimeText preferences
View Preferences.sublime-settings
"bold_folder_labels": true,
"show_tab_close_buttons": false,
"ensure_newline_at_eof_on_save": true,
"trim_trailing_white_space_on_save": true,
"show_definitions": false,
"highlight_line": true,
"highlight_modified_tabs": true,
"auto_complete_commit_on_tab": true,
"translate_tabs_to_spaces": true,
You can’t perform that action at this time.