This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Guide du style de code | |
Ce guide étend et agrandit le PSR-1, le standard basique de codage | |
Le but de ce guide est de réduire la complexité de lecture du code d'auteurs différents. Il le fait en listant un ensemble de règles et d'explication à propos du format du code PHP. | |
Les règles de styles sont issues de points communs entre les différents membre du projet. Quans plusieurs auteurs collaborents ensemble sur différents projets, la mise en place de bonnes pratiques est une aide. Cependant, les avantages de ce guide ne sont pas les règles en elle-mêmes, mais le fait de partager ces règles. | |
Les mots clés "DOIT", "NE DOIT PAS", "REQUIS", "DEVRAIT", "NE DEVRAIT PAS", "RECOMMANDE", "POURAIT", "OPTIONNEL", dans ce document doivent être interprétés comme décrit dans la RFC 2119. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modal Source: https://tailwindui.com/components/application-ui/overlays/modals | |
import React, { ReactNode } from "react"; | |
import { Transition } from "components/transition"; | |
interface Props { | |
/** The modal open/close state */ | |
open: boolean; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** General websites **/ | |
code { font-family: "Operator Mono Lig" !important; font-weight: 200; } | |
pre > code { font-family: "Operator Mono Lig" !important; font-size: 1.2em !important; font-weight: 200; } | |
/** GitHub **/ | |
.blob-code-inner, .blob-num, .highlight pre { font-family: "Operator Mono Lig" !important; font-weight: 200; } | |
.pl-c, .pl-e { font-style: italic; } | |
.pl-c { color: #4CAF50; } | |
/** Prism JS **/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
trait Sortable | |
{ | |
/** | |
* This function receives a $newOrder array parameter, which contains the order in which | |
* we should sort our items after being dragged in the UI. The format of the $newOrder is: | |
* | |
* [ | |
* newIndex => [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// English errors | |
$en_errors = [ | |
"account_already_exists" => "The email address provided for the creation of a deferred account already has an account associated with it. Use the OAuth flow to connect the existing account to your platform.", | |
"account_country_invalid_address" => "The country of the business address provided does not match the country of the account. Businesses must be located in the same country as the account.", | |
"account_invalid" => "The account ID provided as a value for the Stripe-Account header is invalid. Check that your requests are specifying a valid account ID.", | |
"account_number_invalid" => "The bank account number provided is invalid (e.g., missing digits). Bank account information varies from country to country. We recommend creating validations in your entry forms based on the bank account formats we provide.", | |
"alipay_upgrade_required" => "This method for creating Alipay payments is not supported anymore. Please upgrade your integration to us |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Envoyer des emails avec application Laravel :email: | |
Vous avez toujours voulue savoir comment envoyer des emails avec votre application Laravel :confused: ? Vous ne savez pas comment faire :confused: ? | |
Calmez vous :sunglasses: , dans cet article, nous allons présenter étape par étape comment réaliser cela en utilisant vos paramètres SMTP par défauts sans avoir un compte SMTP ou encore acheter un plan SMTP. | |
## Le procéssus | |
Nous allons configurer une application Laravel pour qu'elle puisse envoyer des emails à partir d'un compte Gmail que nous aurons défini. Nous allons avoir un controller qui déclenchera l'envoie de l'email. Il contactera une classe Mailable que nous aurons défini et qui fera appel à la vue portant le contenu de l'email. Un système de gestion d'erreur sera également mis en place pour la récupération des erreurs d'envois d'emails :broken_heart:. | |
## Configuration de Laravel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toTitleCase(str) { | |
return str.replace(/\w\S*/g, function(txt){ | |
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); | |
}); | |
} | |
// or in ES6: | |
var text = "foo bar loo zoo moo"; | |
const ucfirst = text => text.toLowerCase() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"parser": "@typescript-eslint/parser", | |
"parserOptions": { | |
"project": "./tsconfig.json", | |
"tsconfigRootDir": "." | |
}, | |
"env": { | |
"browser": true, | |
"jest/globals": true | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$countries = | |
array( | |
"AF" => "Afghanistan", | |
"AL" => "Albania", | |
"DZ" => "Algeria", | |
"AS" => "American Samoa", | |
"AD" => "Andorra", | |
"AO" => "Angola", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
OlderNewer