Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
⚡️

Madiodio Gaye madiodio

💭
⚡️
View GitHub Profile
View array-filter-map-ids.js
let A = [
{ _id: "34231555", status: "CANCELED", motif: "unable" },
{ _id: "1234551", status: "FAILLED", motif: "no number" },
,
{ _id: "1234455", status: "CANCELED", motif: "injoignable" },
];
let B = ["34231555", "1234455"];
View seed.yml
stage_name_constructor: >
if [ $SEED_STAGE_BRANCH == 'api-prod-client-version' ]; then
echo 'prod'
else
echo $SEED_STAGE_NAME
fi
@madiodio
madiodio / getDelayFromNetworkSpeed.ts
Created Apr 25, 2020 — forked from timc1/getDelayFromNetworkSpeed.ts
Control the speed at which your loading state shows up depending on the user's internet speed.
View getDelayFromNetworkSpeed.ts
const defaultDelay = 500;
export default function getDelay(): number {
if (typeof window !== "undefined") {
if (window.navigator && window.navigator.connection) {
const connection = window.navigator.connection.effectiveType;
switch (connection) {
case "4g":
return defaultDelay;
case "3g":
View force-covid-19-colors.css
:root {
--force-covid19-primary-color: #379956,
--force-covid19-secondary-color: #EF255F,
--force-covid19-tertiary-color: #FFC85B,
--primary-green: #379956,
--primary-red: #EF255F,
--primary-yellow: #FFC85B,
}
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
View createTasksWithClientApp.js
const apiUrl = "http://api.paps.sn/api/v1/"
const apiKey = "7090e4f41fd0dd4750b1bab1b0fa563e222aee17272"
const methodName = "createTasksWithClientApp"
const params = {
email: "example@paps-app.com",
deliveries: [
{
View servces-description.js
export default [
{
name: "Point relais",
text: "Deposer et retirer vos colis en toute sécurité"
},
{
name: "API",
text: "Automatiser toute votre chaine logistique ou juste vos courses en intégrant notre API. Chez Paps, nous savons que votre temps est précieux."
},
{
View getQuotes.js
const apiUrl = "http://api.paps.sn/api/v1/"
const apiKey = "7090e4f41fd0dd4750b1bab1b0fa563e222aee17272"
const methodName = "getQuotes"
const params = {
origin: "Les Almadies, Dakar, Senegal", // Représente l'origine de la course. Doit être une adresse géocode valide
destionation: "Medina, Dakar, Senegal", // Représente la destination de la course. Doit être une adresse géocode valide
packageSize: "small" // Représente le poids du colis à transporter. Doit être entre les valeurs "small" (S correspond à max 5kg), "medium" (M à max 30 kg), "large" (L à max 60 kg) ou "xLarge" (XL à max 100kg). Visitez la documentation pour bien distinguer pour en savoir plus.
@madiodio
madiodio / paps-api-updateTask-ruby-example.rb
Last active Apr 23, 2019
Exempe de code pour mettre à jour une tâche sur Paps API
View paps-api-updateTask-ruby-example.rb
require 'uri'
require 'net/http'
url = URI("https://api.paps.sn/api/v1/updateTaskStatus?apiKey=wthqt63urj8ifq1qhizrtujtn0eyvli3fvmuxjgih5rke7nqag2f&test=true")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
View my-vscode-setting.json
{
"typescript.tsserver.log": "verbose",
// "window.title": "${dirty} ${activeEditorMedium}${separator}${rootName}",
"window.title": "${activeEditorMedium}${separator}${rootName} ⚡",
"terminal.integrated.fontSize": 14,
"terminal.integrated.fontFamily": "Hasklig",
"editor.tokenColorCustomizations": {
"[fairyfloss]": {
"types": {
"foreground": "#ffb0fe"