Skip to content

Instantly share code, notes, and snippets.

View njoyard's full-sized avatar

Nicolas Joyard njoyard

View GitHub Profile
@njoyard
njoyard / bug.html
Created November 9, 2020 23:14
Chart.js 3.0.0-beta.6 bug
<!DOCTYPE html>
<html>
<head>
<title>Stacked Bar Chart</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/luxon/1.25.0/luxon.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chartjs-adapter-luxon.min.js"></script>
<style>
canvas {
-moz-user-select: none;
@njoyard
njoyard / controllers.application\.js
Created October 29, 2020 17:30
EmberArray autotracking
import { A } from '@ember/array';
import Controller from '@ember/controller';
import { action } from '@ember/object';
export default class ApplicationController extends Controller {
items = A([]);
get even() {
return this.items.length % 2 === 0;
}
@njoyard
njoyard / tlp-ac.log
Created February 28, 2019 20:11
Test results on Arch on a Thinkpad x270, with possibly some config remaining from 1.1.
--- TLP 1.1.907 --------------------------------------------
+++ Configured Settings: /etc/default/tlp
TLP_ENABLE=1
TLP_DEFAULT_MODE=AC
TLP_PERSISTENT_DEFAULT=0
DISK_IDLE_SECS_ON_AC=0
DISK_IDLE_SECS_ON_BAT=2
MAX_LOST_WORK_SECS_ON_AC=15
MAX_LOST_WORK_SECS_ON_BAT=60
@njoyard
njoyard / controllers.application.js
Last active February 12, 2019 12:13
Double component render test
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@njoyard
njoyard / controllers.application.js
Last active February 12, 2019 11:06
Double render test
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@njoyard
njoyard / controllers.application.js
Last active February 12, 2019 11:07
Double component render test
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
{"api_root_url": "http://www.nosdeputes.fr/api/document/Amendement/", "id_step": "02_1èrelecture_assemblee_hemicycle", "sujets": {"Article 1er ter": {"titre": "Article 1er ter", "details": "article 1er ter", "amendements": [{"sort": "adopté", "groupe": "ECOLO", "id_api": "120697", "numero": "23", "aut": "M. Coronado, …", "date": "2016-01-18"}, {"sort": "non-voté", "groupe": "NI", "id_api": "120699", "numero": "304", "aut": "M. Fromantin", "date": "2016-01-18"}, {"sort": "non-voté", "groupe": "NI", "id_api": "120695", "numero": "357", "aut": "M. Fromantin", "date": "2016-01-18"}, {"sort": "non-voté", "groupe": "RRDP", "id_api": "120700", "numero": "649", "aut": "M. Krabal, …", "date": "2016-01-18"}, {"sort": "non-voté", "groupe": "RRDP", "id_api": "120901", "numero": "652", "aut": "M. Krabal, …", "date": "2016-01-18"}, {"sort": "non-voté", "groupe": "RRDP", "id_api": "120696", "numero": "653", "aut": "M. Krabal, …", "date": "2016-01-18"}, {"sort": "non-voté", "groupe": "RRDP", "id_api": "120698", "numero": "65
{"api_root_url": "http://www.nosdeputes.fr/api/document/Amendement/", "id_step": "02_1èrelecture_assemblee_hemicycle", "sujets": {"Article 1er ter": {"titre": "Article 1er ter", "details": "article 1er ter", "amendements": [{"sort": "adopté", "groupe": "ECOLO", "id_api": "120697", "numero": "23", "aut": "M. Coronado, …", "date": "2016-01-18"}, {"sort": "non-voté", "groupe": "NI", "id_api": "120699", "numero": "304", "aut": "M. Fromantin", "date": "2016-01-18"}, {"sort": "non-voté", "groupe": "NI", "id_api": "120695", "numero": "357", "aut": "M. Fromantin", "date": "2016-01-18"}, {"sort": "non-voté", "groupe": "RRDP", "id_api": "120700", "numero": "649", "aut": "M. Krabal, …", "date": "2016-01-18"}, {"sort": "non-voté", "groupe": "RRDP", "id_api": "120901", "numero": "652", "aut": "M. Krabal, …", "date": "2016-01-18"}, {"sort": "non-voté", "groupe": "RRDP", "id_api": "120696", "numero": "653", "aut": "M. Krabal, …", "date": "2016-01-18"}, {"sort": "non-voté", "groupe": "RRDP", "id_api": "120698", "numero": "65
@njoyard
njoyard / deputes.md
Last active January 15, 2016 12:13
Permanences des députés depuis nosdeputes.fr

Pour regénérer:

	var deputes = JSON.parse(document.body.firstChild.innerHTML).deputes;
	document.body.innerHTML = '<pre>'
	+ deputes.sort(function(a, b) {
		return a.depute.nom_de_famille.localeCompare(b.depute.nom_de_famille);
	}).map(function(dep) {