Skip to content

Instantly share code, notes, and snippets.


Frédéric Camblor fcamblor

View GitHub Profile
fcamblor / filewriter-threadsafety.js
Last active Jan 7, 2021
cordova-file concurrent writes reproducer
View filewriter-threadsafety.js
function testingDirEntryFor(directoryName) {
return new Promise((resolve, reject) => {
window.resolveLocalFileSystemURL(cordova.file.dataDirectory, (rootDataDir) => {
rootDataDir.getDirectory(directoryName, { create: true }, (dirEntry) => {
}, (error) => reject(error));
}, (error) => reject(error));
fcamblor / identifyDevoxxScheduleOptims.js
Last active Feb 26, 2020
Helping script to adjust DevoxxFr schedule columns (rooms) width
View identifyDevoxxScheduleOptims.js
async function loadScript(url) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
return new Promise((resolve) => setTimeout(resolve, 1000));
fcamblor /
Last active Dec 20, 2019
Variables extractor

Idea is to provide a working implementation for extractVariablesFrom(str) js function. Basically, this function is intended to extract variable names from a string, considering that variable name should be surrounded with double or triple braces (mixing not allowed) and name should not contain any space. Obviously, variable may appear anywhere in the string (at the start/end typically, or "glued" to another variable).

Background : I translate an application into many languages. A translation can either be a raw string or a handlebar template string. In latter case, I give to my translator the raw template string (with some handlebar variables embedded into it) and I expect them to NOT alter this template string (typically, don't remove braces nor translate variable names).

fcamblor /
Last active Dec 12, 2019
Et l'heureux gagnant est...

.... CAI !

fcamblor /
Last active Dec 6, 2019
mv / cp latest download in target dir
function cpLatestDlTo(){ cp "$HOME/Downloads/$(ls -t ~/Downloads | head -n 1)" "$1" }
function mvLatestDlTo(){ mv "$HOME/Downloads/$(ls -t ~/Downloads | head -n 1)" "$1" }
fcamblor / Dockerfile
Last active Nov 16, 2020
Async profiler on docker-alpine
View Dockerfile
FROM tomcat:7-jre8-alpine
# See
RUN apk update && apk add --no-cache libc6-compat perl openjdk8-dbg
RUN mkdir /usr/local/async-profiler/ &&\
wget -O /usr/local/async-profiler/async-profiler.tar.gz &&\
cd /usr/local/async-profiler/ &&\
tar -xvzf async-profiler.tar.gz &&\
rm -f /usr/local/async-profiler/async-profiler.tar.gz
fcamblor /
Last active Nov 9, 2020
[MAC users] Updating Oracle JDK to OpenJDK

Starting from February 2019, Oracle JDK updates will require Commercial license if you make any business using Java (eg, you're a Java Developper not spending only your spare time developping with Java).

It includes Java not only on your server, but on your laptop as well.

Source | Source

What's nasty is Java versions will remains free to download since if you use it as an individual/personal use, you won't be concerned by the commercial aspects of the license.

fcamblor /
Last active May 9, 2021 — forked from eddiemoya/
Flip the last two commits in a branch using git-cherry-pick, git-update-ref and git-rev-parse. Interesting exercise using quite a bit of plumbing commands.
git rev-parse --verify $flip_last_branch_name > /dev/null 2>&1;
if [ "$res" = "0" ]; then
echo "An ongoing flip-last is already in progress ($res) ... execute following command to remove it : git branch -D $flip_last_branch_name";
exit -1;
fcamblor /
Last active Jun 20, 2019
CFP Speaker infos

Créateur de la conférence BDX I/O et ancien Bordeaux JUG leader, Frédéric aime cotoyer les différentes communautés tech et apprendre de nouvelles choses.
Le jour, il est Tech Lead sur les technos web/mobile chez 4SH. La nuit, il se transforme en commiter OSS (RestX et plein d'autres petits projets).
Il est extrêmement enthousiaste d'enfin voir arriver du typage statique sur le front avec Typescript.
⚠️Attention ⚠️: il trouve très souvent une solution à un problème avec une Google Spreadsheet.