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
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 {
eval(str);
} catch(e) {
alert('Your browser does not support ES6!')
}
@davidbgk
davidbgk / folder2html.md
Last active Jul 8, 2019
Given a folder containing CommonMark files, turn it into HTML.
View folder2html.md

Folder2HTML

Goal

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

Requirements

File structure

@davidbgk
davidbgk / setup.py
Created Jan 14, 2017 — forked from anonymous/setup.py
setup.py template
View setup.py
#!/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
`public/*.{html,ico,json,png}`,
],
dontCacheBustUrlsMatching: [
/\.(js|json)$/, // I'm cache busting js and json files myself
@davidbgk
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>
<script>
document.ready = new Promise((resolve) =>
document.addEventListener('DOMContentLoaded', resolve))
document.ready.then((event) => new window.Example(event.target).init())
</script>
<p>Hello world</p>
@davidbgk
davidbgk / top-ten.md
Last active Nov 15, 2016
Bonnes pratiques et fichiers issus de #OpenSirene
View top-ten.md

OpenSirene


1. Nommage

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

@davidbgk
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,
View gist:bc358a9e89bfbf3bf4f79cd5f6d5bbc8
<script>
window.Promise || document.write('<script src="https://unpkg.com/es6-promise@3.2.1/dist/es6-promise.min.js"><\/script>');
window.fetch || document.write('<script src="https://unpkg.com/whatwg-fetch@1.0.0/fetch.js"><\/script>');
</script>
@davidbgk
davidbgk / visio.md
Last active Oct 25, 2016
Visioconférences à plus de 3
View visio.md

Visioconférences à plus de 3

  • établir le périmètre avant (sujets/personnes concernées)
  • désactiver la vidéo et le micro par défaut après avoir vu tout le monde en intro et avant que tous les ventilos ne s’emballent (ça demande d’avoir une bonne persistance rétinienne quand on parle dans le vide 😁)
  • activer la vidéo pour montrer que l’on souhaite parler ensuite
  • activer le micro le temps de prendre la parole seulement. Pro-tip : la touche M permet de le faire au clavier sur appear.in et encore mieux utiliser une app dédiée qui consiste à appuyer sur une touche pour activer le micro !
  • éviter les bruits parasites le plus possible, notamment toute action proche du micro (tripatouiller un truc machinalement, conversation au bureau d’à côté, chat/enfant qui miaule 😼, se gratter la barbe avec son fil d’écouteurs/micro)
  • terminer sur date/horaire du point suivant ?
  • mentionner explicitement lorsque le sujet change et que les participa
@davidbgk
davidbgk / promise-all.js
Created Sep 8, 2016 — forked from naholyr/promise-all.js
Run promise-based async API in series or concurrency
View promise-all.js
// ( T1 => Promise<T2> ) => Array<T1> => Promise<Array<T2>>
export const concurrent = foo => vals =>
Promise.all(vals.map(foo))
export const series = foo => vals =>
vals.reduce((p, val) => p.then(rs => foo(val).then(r => rs.concat([val]))), Promise.resolve([]))
// Usage: promiseOfValues.then(promiseAll.concurrent(functionReturningAPromiseFromAValue))
You can’t perform that action at this time.