Skip to content

Instantly share code, notes, and snippets.

{
"config": {
// Seuil d'inactivité: Un client est considéré inactif s'il n'a pas commandé depuis X jours
"inactivityDays": 30,
// Fenêtre d'analyse: Nombre de jours d'historique à analyser pour calculer la consommation moyenne
"analysisWindowDays": 180,
// Couverture cible: Nombre de jours de stock souhaité (ex: 14 jours de stock)
"targetCoverage": 14,
<script setup lang="ts">
import { MessageType } from "../../../enums";
//
// if extend is true , error message is shown on bottom on the slotted component. Eg Case : Form
// If extend is false , error message will replace the slotted component. Eg Case : Data list
const props = {
extend: {
type: Boolean,
default: false,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file has been truncated, but you can view the full file.
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -1.54681,47.16069 ]
},
"properties": {
This file has been truncated, but you can view the full file.
[
{
"id": "000558e4-f6b8-4bcf-a855-7f3864acc006",
"location_type": "301",
"lng": -1.54681,
"lat": 47.16069,
"ratio": 1.777
},
{
"id": "000e8588-0339-42ce-9592-d89fe2dac209",
@dimitrileduc
dimitrileduc / parentCallChildFunction.js
Last active April 9, 2022 10:03
call child function from parent
https://stackoverflow.com/questions/67263476/how-to-call-child-function-from-parent-react-hook
@dimitrileduc
dimitrileduc / cities.js
Last active April 8, 2022 20:24
React autocomplete cities API
import React, {useEffect, useState} from 'react';
import axios from 'axios'
import { Hint } from 'react-autocomplete-hint';
import './App.css'
function App() {
const [hintData, setHintData] = useState([])
const [text, setText] = useState('')
var hintArray = []
const getData = async () => {
@dimitrileduc
dimitrileduc / handleSubmit-props.js
Last active April 5, 2022 20:11
handleSubmit from props
/*
Similar to passing the contacts list to our PeopleList component, we passed down the addPerson() function to our AddPersonForm using a prop called handleSubmit.
Now, our PeopleList can call the handleSubmit function that it received when the form is submitted,
to add a new person to the list:
*/
function AddPersonForm(props) {
const [ person, setPerson ] = useState("");
@dimitrileduc
dimitrileduc / sharingState.js
Created April 5, 2022 19:25
react Sharing State
/*
The ContactManager component receives the initial contacts list using props, saves it in its state.
Then it passes down the contacts list to its child component.
*/
function ContactManager(props) {
const [contacts, setContacts] = useState(props.data);
return (
<div>
@dimitrileduc
dimitrileduc / createRoot.js
Created April 5, 2022 19:19
React createRoot
import React from 'react';
import {createRoot} from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
const rootElement = document.getElementById('root');
const root = createRoot(rootElement);