Skip to content

Instantly share code, notes, and snippets.

View jblievremont's full-sized avatar
🐼
.

Jean-Baptiste Lièvremont jblievremont

🐼
.
  • France, somewhere near the Swiss border
  • X @mithfindel
View GitHub Profile
@jblievremont
jblievremont / InactivityFoil.ino
Created January 8, 2021 13:14
InactivityFoil - Wiggle the mouse every 30 seconds to avoid session lock
/*
InactivityFoil - Wiggle the mouse every 30 seconds to avoid session lock
Copyright 2021 Jean-Baptiste Lievremont
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
@jblievremont
jblievremont / loop.js
Created June 10, 2020 09:21
Beware semicolons
for (let i=0; i < 42; i ++) { console.log(i) }
@jblievremont
jblievremont / index.php
Created May 22, 2020 17:53
Mon premier CRUD en PHP (à servir sur `/api/notes`)
<?php
/*
* Mapping:
* GET /api/notes => list all notes
* POST /api/notes => create a note
* GET /api/notes/:id => get one note
* DELETE /api/notes/:id => delete a note by id
* PUT /api/notes/:id => update a note
*/
@jblievremont
jblievremont / keybase.md
Created December 12, 2017 21:32
keybase.md

Keybase proof

I hereby claim:

  • I am jblievremont on github.
  • I am mithfindel (https://keybase.io/mithfindel) on keybase.
  • I have a public key ASDHDHpKlpX1_W3_SGfD_FpGf4LVI00OSuJauQG9Dc5iRwo

To claim this, I am signing this object:

@jblievremont
jblievremont / functional-utils.js
Created November 18, 2016 14:15 — forked from bendc/functional-utils.js
A set of pure ES2015 functions aimed to make functional JavaScript more idiomatic.
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)
@jblievremont
jblievremont / Scroll exchange with has_parent filter
Created January 9, 2014 09:11
The attached files describe HTTP exchanges made with the REST API of an ElasticSearch 0.90.6 node, to describe the problem encountered in this thread: https://groups.google.com/forum/#!topic/elasticsearch/pfQ1wiTeObk The node has one index named 'rules' with 2 types ('rule' and 'active_rule'). The Java code responsible for the calls can be found…
>>>
POST /rules/active_rule/_search?search_type=scan&scroll=1m
{
"size": 25,
"fields": [
"id"
],
"filter": {
"bool": {
"must": [