Skip to content

Instantly share code, notes, and snippets.

View exaucae's full-sized avatar

Chrys Exaucet exaucae

View GitHub Profile
@exaucae
exaucae / beta_acceptance_rejection.py
Last active January 10, 2021 20:23
monte-carlo-simulation
"""
we tackle the acceptance rejection alogorithm with the beta law
It is well established that the rejection method allows to simulate data
of the normal law N (0; 1) according to a certain algorithm.
"""
@exaucae
exaucae / delete-node-modules.txt
Last active April 16, 2021 12:42
Delete all nodules like a pro
Here are two way to delete node modules.
# The hard way
- cd into your target folder and according to your OS, run the appropriate command
- linux based systems: find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
- windows: FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" rm -rf "%d"
# the easy way
@exaucae
exaucae / mssql-convert.sql
Last active April 16, 2021 12:59
sql-server-convert
-- From datetime to string
-- The third argument of the convert function specifies the datetime format
DECLARE @date DATETIME = '2020-10-21 17:38:54.840'
BEGIN
SELECT CONVERT(varchar, @date, 115)
END
@exaucae
exaucae / Vagrantfile
Created April 22, 2021 00:39
PostgreSQL vagrant file
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "generic/debian10"
config.vm.box_version = "3.2.2"
config.vm.box_url = "https://app.vagrantup.com/generic/boxes/debian10"
config.vm.network "forwarded_port", guest: 5433, host: 5433, host_ip: "127.0.0.1"
Workers are just scripts that runs on a separate thread from the main browser thread. Javascipt has 3 categories:
- Web workers : general purpose workers
- Service workers : proxy between the browser and the network / cache; have custom methods
- Worklets: hook into the browser’s rendering pipeline, enabling you to have low-level access to the browser’s rendering processes such as styling and layout
Workers:
- are registered in the main javascript file of your project
- do not have access to the DOM; thus get messages and props via callbacks ( postMessage & onMessage )
@exaucae
exaucae / browser-engines
Last active May 5, 2021 10:11
guide to different browser engines
Every browser is backed by a rendering engine to draw the HTML/CSS web page.
- Firefox → Gecko
- Safari → WebKit
- Chrome → Blink (a fork of Webkit).
- Opera → Blink (no longer uses Presto since Feb 2013)
- IE → Trident (discontinued)
- Edge → EdgeHTML (clean-up fork of Trident) (Edge switched to Blink in 2019)
css prefixes:
@exaucae
exaucae / flexbox.txt
Last active May 5, 2021 10:53
flexbox ressources
Flexbox layout is most appropriate to the components of an application, and small-scale layouts,
while the Grid layout is intended for larger scale layouts.
The main idea behind the flex layout is to give the container the ability to alter its items’ width & height (and order)
to best fill the available space.
shorthand properties:
- flex: [flex-grow] [flex-shrink] [flex-basis];
- flex-flow: [flex-direction] [flex-wrap]
References:
@exaucae
exaucae / grid-layout.html
Created May 5, 2021 13:01
css grid layout template
<!DOCTYPE html>
<html>
<head>
<style>
.item1 { grid-area: header; }
.item2 { grid-area: sidebar; }
.item3 { grid-area: main; }
.item4 { grid-area: aside; }
.item5 { grid-area: footer; }
@exaucae
exaucae / odoo-models.txt
Last active May 26, 2021 14:48
notes about Odoo structure
========================
ODOO building blocs
==============
I expose Odoo 14 models structure here. Have a look to reference for further informations.
1. Models: represents a business object
They are built around three main base ORM classes BaseModel, AbstractModel and Model
Models are not directly accessible; one should use recordsets to do so.
@exaucae
exaucae / mvn-uber-jar-plugins.xml
Created August 31, 2021 14:23
maven plugins to fat jar your project
<!-- https://stackoverflow.com/questions/20801874/how-to-build-an-executable-jar-from-multi-module-maven-project/20802018#20802018 -->
<!-- https://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven?page=1&tab=votes#tab-top -->
<build>
<plugins>
<!-- mvn package -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>