Skip to content

Instantly share code, notes, and snippets.

View mouadziani's full-sized avatar
🕶️
Trance, NEVER been boring

Mouad Ziani mouadziani

🕶️
Trance, NEVER been boring
View GitHub Profile
@mouadziani
mouadziani / AwsCognitoIdentitySRP.php
Created August 15, 2022 16:50 — forked from jenky/AwsCognitoIdentitySRP.php
AWS Cognito Identity SRP authentication helper
<?php
use Aws\AwsClient;
use Aws\Result;
use Carbon\Carbon;
use phpseclib3\Math\BigInteger;
class AwsCognitoIdentitySRP
{
const N_HEX = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1'.
document.addEventListener('alpine:init', () => {
Alpine.store('breakpoint', {
listeners: {},
init() {
const breakpoints = {
sm: 640,
md: 768,
lg: 1024,
xl: 1280,
<?php
// Replace the first occurence of string
function str_replace_first($from, $to, $content) {
$from = '/'.preg_quote($from, '/').'/';
return preg_replace($from, $to, $content, 1);
}
echo str_replace_first('ADT', 'CHD', 'abcdefqsdfhsgqhd(ADTfhqsdf (ADT)(INF) abcdef abcdef');
@mouadziani
mouadziani / calculateBusinessDays.js
Created June 7, 2019 14:53 — forked from icemilo/calculateBusinessDays.js
Calculates business days between two dates using moment.js
var moment = require('moment');
function calculateBusinessDays(firstDate, secondDate){
//Initiallize variables
var day1 = moment(firstDate);
var day2 = moment(secondDate);
var adjust = 0;
if((day1.dayOfYear() === day2.dayOfYear()) && (day1.year() === day2.year())){
return 0;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Increment-increase-Input</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<body>
<br><br>
<div class="container">
@mouadziani
mouadziani / laravel_facades.md
Created February 5, 2019 23:46 — forked from poing/laravel_facades.md
Laravel Facades

Understanding Facades in Laravel

What's a Facade?

The Laravel explination, shown below is confusing.

Facades provide a "static" interface to classes that are available in the application's service container. Laravel ships with many facades which provide access to almost all of Laravel's features. Laravel facades serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods.

Many examples use Cache::get('key') to demonstrate how a Facade works. Comparing the following code to the utility that a Facade provides.

@mouadziani
mouadziani / settings.json
Last active May 13, 2019 05:05
Awesome settings for VSCode
{
"workbench.colorTheme": "Material Theme Darker",
"workbench.iconTheme": "Monokai Classic Icons",
"materialTheme.cache.workbench.settings": {
"themeColours": "Default",
"accent": "Teal",
"accentPrevious": "Orange"
},
"editor.fontSize": 14,
"editor.lineHeight": 26,
# Dictionnaire des prénoms attribués aux enfants nés en France et en départements d'outre-mer entre 1900 et 2015.
# https://www.insee.fr/fr/statistiques/2540004
A
AADEL
AADIL
AAKASH
AALIYA
AALIYAH
AALYA
AALYAH