Skip to content

Instantly share code, notes, and snippets.

View bwindels's full-sized avatar

Bruno Windels bwindels

  • Brest region, France
View GitHub Profile
class Sizer {
constructor(container, vertical, reverse) {
this.container = container;
this.reverse = reverse;
this.vertical = vertical;
}
getItemPercentage(item) {
/*
const flexGrow = window.getComputedStyle(item).flexGrow;
<!DOCTYPE html>
<html>
<head>
<style>
.mx_hellolist {
height: 200px;
width: 300px;
background: salmon;
box-sizing: border-box;
}
@bwindels
bwindels / example.css
Created November 6, 2018 14:12
scroll gradient indicator
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
body {
background: #F2F5F8;
font: 120% sans-serif;
}
import {div, span} from "el";
div({tag: ""}, ["hello", span({className: "foo"},"foo"), "bar"])
// <div tag="">hello<span class="foo">foo</span>bar</div>
@bwindels
bwindels / timeline.html
Last active February 20, 2019 16:05
align last event tile to bottom of viewport
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
body {
padding: 10px;
margin: 0;
display: flex;
flex-direction: column;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
body {
padding: 10px;
margin: 0;
display: flex;<!DOCTYPE html>
<html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
#editor {
border: 1px solid black;
min-height: 20px;
white-space: pre;
}
@bwindels
bwindels / notes.md
Last active July 8, 2019 22:03
Notes wrt to EROI and levels needed for a complex society

Notes while trying to wrap my head around the discussion held at https://www.researchgate.net/post/Why_is_quality_of_life_limited_by_EROI_with_renewable_Energy.

The discussion there revolves around, and my initial calculations indeed were, as James E. Miller presents them, that you input an initial 1 unit of enery, and with a PV or 3:1 EROI, you take 1 for society, and 1 for investing in another PV, and stack that way. This reasoning does seem to imply that you can stack them, but ignores the fact that a society of comparable complexity (a prerequisite to being able to build PVs in the first place) to ours (so every person in society) needs an EROI of 15-10:1

So, if you scale the example down to a few PVs, you also have to scale the whole machinery we have for PV production down. For that to work, everybody needs an EROI of lets say 10:1, and all those people are all assumed to work ~8 hours per day at current well-being levels. If you need more people to do the job, PVs become more expensive (or require mo

const acorn = require("acorn");
const walk = require("acorn-walk");
walk.simple(acorn.parse("import i18n from \"i18n\"; const str = i18n`foo ${bar} haha`", {sourceType: "module"}), {
// https://github.com/estree/estree/blob/master/es2015.md#template-literals
TaggedTemplateExpression(node) {
console.log("TaggedTemplateExpression:")
console.log(JSON.stringify(node, undefined, 2));
},
ImportDeclaration(node) {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
@keyframes spinner {
0% {
transform: rotate(0);
stroke-dasharray: 0 0 10 90;
}