Skip to content

Instantly share code, notes, and snippets.

View mckenziearts's full-sized avatar
🏠
Working from home

Arthur Monney mckenziearts

🏠
Working from home
View GitHub Profile
@npotier
npotier / PSR-2-coding-style-guide-french
Created September 6, 2016 10:13
PSR-2 traduit en français
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.
@stevecastaneda
stevecastaneda / ModalExample.tsx
Last active July 26, 2020 20:17
[Typescript] Modified Transition React Component to Support Nested Transitions w/ Tailwind
// 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;
}
@imliam
imliam / operator-mono-lig.css
Created July 5, 2018 12:37
Use the Operator Mono Lig typeface on any website.
/** 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 **/
@iksaku
iksaku / Sortable.php
Created September 19, 2020 18:31
A helper trait that provides basic PHP compatibility with @livewire's Sortable package
<?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 => [
@Ladinstar
Ladinstar / french_and_english_translation_of_stripe_code_error.php
Last active November 5, 2021 00:57
French and English translation of Stripe online payment error codes in PHP array
<?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
# 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
@whoisryosuke
whoisryosuke / gist:5b0d54926c997a6620945d780958ea74
Created September 29, 2018 01:05
Javascript / ES6 - Uppercase first letter of each word (2 ways) -- via: https://stackoverflow.com/a/4878800
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()
@1natsu172
1natsu172 / .eslintrc
Last active July 5, 2023 10:23
My airbnb based ESLint config for "typescript-eslint" with React & prettier
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"tsconfigRootDir": "."
},
"env": {
"browser": true,
"jest/globals": true
},
@djaiss
djaiss / gist:2938259
Created June 15, 2012 19:13
PHP List of countries
<?php
$countries =
array(
"AF" => "Afghanistan",
"AL" => "Albania",
"DZ" => "Algeria",
"AS" => "American Samoa",
"AD" => "Andorra",
"AO" => "Angola",
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
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
}