Skip to content

Instantly share code, notes, and snippets.

View camille-hdl's full-sized avatar

Camille Hodoul camille-hdl

View GitHub Profile
@wirths
wirths / bitbucket-pipelines.yml
Created December 5, 2019 16:56
Bitbucket Pipelines - Create Pull Request (PR) with default reviewers
image: node:12
definitions:
steps:
- step: &create-pr
name: Create Pull Request
caches:
- node
script:
- apt-get update
@jpvincent
jpvincent / optimizedFor.js
Last active November 25, 2021 17:12
never blocking loop mechanism, using setTimeout 0 trick and time control to break the loop and let the browser breath
/**
* NEVER BLOCKING LOOP : implementation of the infamous setTimeout 0 hack, with time checking in order to guarantee fluidity without sacrificing execution speed.
*
* USAGE :
* var array = ["a way too big array that is heavy to process"]
* optimizeFor({
* nbIterations: array.length,
* each:function( index ) {
* doSomethingUsefulWith( array[ index ] );
* },