Skip to content

Instantly share code, notes, and snippets.

View stephane777's full-sized avatar
๐ŸŒŽ
Protect.

Stephane Candelas stephane777

๐ŸŒŽ
Protect.
  • London, UK.
View GitHub Profile
@stephane777
stephane777 / Tricks
Last active December 24, 2020 22:42
# CSS3 tricks
## Useful links:
[Can I use](https://caniuse.com)
[Box model](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Box_model)
[Width & height](https://www.w3schools.com/css/css_dimension.asp)
[Display](https://developer.mozilla.org/en-US/docs/Web/CSS/display)
[Pseudo element](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements)
[CSS Specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity)
[Positioning](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Positioning)
## Definition
### The Store
The store contains the store and 3 methods which will make the change predictable
as much as possible.
function createStore (reducer) {
<!--// The store should have four parts-->
```bash
git checkout dev
git pull origin
git branch
git checkout DEV-2136/fix/fix-validation-form-message
git log --oneline
git merge dev
git push origin DEV-2136/fix/fix-validation-form-message
git rebase -i HEAD~20
git config
## Git Blobs and trees
### Asking Git for the SHA1
> echo 'Hello, World!' | git hash-object --stdin
8ab686eafeb1f44702738c8b0f24f2567c36da6d
## Git Commits
commit are stored in .git/objects
tree .git/objects
## Init package
npm install -y
## Install live server
npm install --save-dev nodemon
or
npm install -D nodemon
## Export a function
const myFunc = (name) => console.log(`Welcome ${name}`);
module.exports = myFunc;
// saved in myFunc.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
html,body {
height: 100%;
}
### OPEN Webpack.config.js
Without this the browser will say :"I don't have instruction on how to handle the url with the query string!"
The modification will be redirected to the index.html page and then React Router can handle the change and send the right Route.
output :{
publicPath: '/'
}
devServer :{
function add (x, y) {
return x + y
}
function makeAdder (x, addReference) {
return function (y) {
return addReference(x, y)
}
}
### Initiate your project
yarn init
### Install react and react-dom
yarn add react react-dom
### Install webpack dev server
yarn add -D webpack webpack-dev-server webpack-cli
### Install babel
yarn add -D @babel/core @babel/preset-react
## Install babel loader
yarn add -D babel-loader