Skip to content

Instantly share code, notes, and snippets.

@kochmaxence
kochmaxence / test_promises.js
Created June 8, 2017 11:41
Why you should return in callback?
/**
* Note that you don't have a "return_err" in your console.
* But you have "noreturn_err".
*
* Even if you resolve/reject your promise, it's still a function that'll
* keep its execution until it is returned.
*/
const log = tag => (...args) => console.log(tag, ...args);
new (function() {
const someObject = {
config: {
key: {
hello: 'world',
hola: 'friend'
}
}
};
function test(
a = '_a default_\n',
b = '_b default_\n',
c = '_c default_\n',
d = '_d default_\n',
e = '_e default_\n',
f = '_f default_\n'
) {
console.log(a, b, c, d, e, f);
}
@kochmaxence
kochmaxence / blocking-array-reduce.js
Last active July 12, 2017 16:36
Differences between blocking & non-blocking array reduce
const bigArray = Array.apply(null, Array(4000)).map(Number.prototype.valueOf, 1);
let check = setInterval(() => console.log('-'), 0);
const result = bigArray.reduce((acc, value, index) => {
acc[index] = value;
console.log('ITERATION');
return acc;
}, {});
@kochmaxence
kochmaxence / stoppableReduceAsync.js
Last active December 14, 2018 16:27
An example implementation of reduce with a stop function callable in iterator
const stoppableReduce = (f, initialValue, collection, cb) => {
const _collection = collection.slice();
let stopper = false;
const iterator = (acc, index, list) => {
const item = list[index];
const nextAcc = f(acc, item, () => {
stopper = true;
@kochmaxence
kochmaxence / Engine.ini
Last active January 5, 2019 14:59
BREACH - Minimal config
[SystemSettings]
r.MotionBlur.Max=0
r.MotionBlurQuality=0
r.DefaultFeature.MotionBlur=0
r.DepthOfFieldQuality=0
r.PostProcessAAQuality=0
r.DefaultFeature.AntiAliasing=0
r.SceneColorFringe.Max=0
r.SceneColorFringeQuality=0
r.Tonemapper.GrainQuantization=0
@kochmaxence
kochmaxence / Engine.ini
Last active January 12, 2019 21:46
BREACH - No motion blur
[SystemSettings]
r.MotionBlur.Max=0
r.MotionBlurQuality=0
r.DefaultFeature.MotionBlur=0
r.DepthOfFieldQuality=0
r.PostProcessAAQuality=0
r.DefaultFeature.AntiAliasing=0
r.SceneColorFringe.Max=0
r.SceneColorFringeQuality=0
r.Tonemapper.GrainQuantization=0

Keybase proof

I hereby claim:

  • I am kochmaxence on github.
  • I am kochmaxence (https://keybase.io/kochmaxence) on keybase.
  • I have a public key whose fingerprint is 0DB0 DE42 8CF4 21C0 3551 6998 AE18 3777 20FE 85F5

To claim this, I am signing this object: