Skip to content

Instantly share code, notes, and snippets.

View jefBinomed's full-sized avatar

Jean-François Garreau - Binomed jefBinomed

View GitHub Profile
@jefBinomed
jefBinomed / FaceDetector.js
Created December 3, 2020 12:49
2020-fugu-face-detection
const faceDetector = new FaceDetector({
// (Optional) Hint to try and limit the amount of detected faces
// on the scene to this maximum number.
maxDetectedFaces: 5,
// (Optional) Hint to try and prioritize speed over accuracy
// by, e.g., operating on a reduced scale or looking for large features.
fastMode: false
});
try {
const faces = await faceDetector.detect(image);
@jefBinomed
jefBinomed / detector.js
Created October 27, 2020 16:58
2020-10-push-the-limit-detector
export class Detector {
/**
* Will create the write dectector object according to the type.
* @param type: the type of detector to use -> see constant TYPES to use the correct types
* @param options: each detector should work with speficics options that could override. Check the desire constant. Note that text detector don't need options
**/
constructor(type, options) {
this.type = type;
switch (type) {
case TYPES.face:
@jefBinomed
jefBinomed / HelperJSInCSS.js
Created November 16, 2019 21:55
Javascript class that helps you to play with Custom Properties to turn them into JS Code and to execute the code
export class HelperJsInCss{
constructor(element, customProperty, loop, args){
this.element = element
this.customProperty = customProperty
this.lastValue = undefined
this.loop = loop
this.args = args
if (loop){
window.requestAnimationFrame(this.checkElements.bind(this))

SFEIR Individual Contributor License Agreement

In order to clarify the intellectual property license granted with Contributions from any person or entity, SFEIR SA ("SFEIR") must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of SFEIR; it does not change your rights to use your own Contributions for any other purpose.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to SFEIR. Except for the license granted herein to SFEIR and recipients of software distributed by SFEIR, You reserve all right, title, and interest in and to Your Contributions.

  1. Definitions.

"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with SFEIR. For legal entities, the entity making a Contribution and all other enti

@jefBinomed
jefBinomed / wrong-vue.html
Created November 30, 2018 16:20
2018-countdown-wrongvue
<Score
v-if="planets.length > 0"
v-bind:planet="planets[0]"
></Score>
<Score
v-if="planets.length > 1"
v-bind:planet="planets[1]"
></Score>
<Score
v-if="planets.length > 2"
@jefBinomed
jefBinomed / good-vue.html
Created November 30, 2018 16:19
2018-countdown-goodvue
<Score
v-for="planet in planets.slice(0,10)"
:key="planet.id"
v-bind:planet="planet"
></Score>
@jefBinomed
jefBinomed / timer-last-song.js
Created November 30, 2018 16:18
2018-countdown-time-management-audio
const timeBeforeLastSongs = 60 * 1000; // 1 Minute
const dropTimeForLastSong = 5 * 1000; // 5 sec
export default {
name: 'countdown',
components: { Galaxy, ScoreList, Timer },
// ...
methods: {
/// ...
timeUpdate(event) {
@jefBinomed
jefBinomed / audio-player.js
Created November 30, 2018 16:16
2018-countdown-audioplayer-v1
'use strict'
import {
PLAYLIST,
LASTS_SONGS_PLAYLIST
} from './playlist.js';
/**
* Class for playing music
*
* We create an invisible audio element and we play music on it
@jefBinomed
jefBinomed / timer.js
Created November 30, 2018 16:15
2018-countdown-timer-es6
'use strict';
export default class Timer {
constructor(callback){
// Target Time : '2018-10-18T09:00:00'
this.targetDate = new Date(Date.now() + 30 * 1000 + 120 * 1000);
this.callback = callback;
this.checkTime();
}
@jefBinomed
jefBinomed / firestore.rules.js
Created November 30, 2018 16:13
2018-countdown-security-firestore
service cloud.firestore {
match /databases/{database}/documents {
// Generic method that checks if the email of the currently authenticated user is contained in the admin collection
function isAdmin() {
return request.auth != null
&& get(/databases/$(database)/documents/admins/adminList).data[request.auth.token.email] == true
&& request.auth.token.email_verified == true;
}
// The admin collection is in read only for the admins