Skip to content

Instantly share code, notes, and snippets.

View iGitScor's full-sized avatar
🤜
Making a better world

Sebastien Correaud iGitScor

🤜
Making a better world
View GitHub Profile
@iGitScor
iGitScor / question-1.md
Last active May 8, 2021 09:48
HiringProcess

Imagine that you have two classes named "Animal" and "Dog" and you want the class "Dog" to have all the properties and methods from the class "Animal", how would you do it? How is this called? What's the benefit?

To share properties and methods, we can define an inheritance so dog instances will have access to animal properties and methods. The main benefit is to avoid duplicated code, to define shared logic and eventually to precise specific behavior in subclasses.

class Animal {}
@iGitScor
iGitScor / ui-test.js
Created February 22, 2019 10:57
Snapshot
const puppeteer = require('puppeteer');
function pages(page) {
return 'http://localhost:8100/#/' + page;
}
describe('Relayed', () => {
let browser;
let page;
@iGitScor
iGitScor / .babelrc
Created February 7, 2019 10:24 — forked from andrewmunro/.babelrc
Sequelize cli with ES6
{
"presets": ["es2015"],
"plugins": [
"add-module-exports"
],
}
@iGitScor
iGitScor / script.sh
Created November 6, 2018 11:37
Remove unnecessary architecture in build phase (Xcode)
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
@iGitScor
iGitScor / normalize.js
Last active April 4, 2018 15:39
Normalize
"mon string avé des accents".normalize("NFD").replace(/[\u0300-\u036f]/g, ''); // Remove accent
"mon string avé des accents".normalize("NFD").replace(/([^a-zA-Z0-9 ]*)/g, ''); // Keep only letters, numbers and space
"mon string avé des accents".normalize("NFD")
.replace(/[\u0300-\u036f]/g, '')
.replace(/([^a-zA-Z0-9 ]*)/g, '') // Remove accent and then keep letters, numbers and space
"mon string avé des accents".normalize("NFD")
.replace(/[\u0300-\u036f]/g, '')
.replace(/[\/!-,]/g, '') // Remove slash ("/"), interrogation point ("!"), dash ("-"), comma (",")
@iGitScor
iGitScor / game.js
Created February 14, 2018 16:45
Doodle jump Santa Claus
(function (window, document, XMLHttpRequest) {
window.onload = function () {
// RequestAnimFrame: a browser API for getting smooth animations
window.requestAnimFrame = (function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
function(callback) {
window.setTimeout(callback, 1000 / 60);
};
})();
@iGitScor
iGitScor / dom-depth.css
Last active July 19, 2017 13:23
See DOM depth
.content * { background: rgba(255, 0, 235, 0.1) }
@iGitScor
iGitScor / example-2.js
Created March 24, 2017 09:07
Webpack content replacer plugin - Log level
var winston = require('winston'):
class Logger {
static silent; // 0
static logfile; // 1
static strictError; // 2
constructor(_loglevel) {
this.loglevel = _loglevel || Logger.silent;
this.outputWriter = new Winston(...params, this.getConfiguration());
@iGitScor
iGitScor / root.css
Created November 4, 2016 20:27
:root tip
:root {
font-size: calc(16px + (24 - 16) * (100vw - 400px)/(800 - 400));
line-height: calc(1.3em + (1.5 - 1.3) * ((100vw - 21em)/(35 - 21)));
}
export class Dimension {
width: int;
height: int;
constructor(width: int, height: int) {
this.width = width;
this.height = height;
}
}