Skip to content

Instantly share code, notes, and snippets.

View duboiss's full-sized avatar
🌐
Just saving the world

Steven DUBOIS duboiss

🌐
Just saving the world
View GitHub Profile
@duboiss
duboiss / date.fr.xliff
Created August 1, 2019 18:54
date.fr.xliff file for Twig DateExtension
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="diff.ago.year">
<source>diff.ago.year</source>
<target>il y a 1 an|il y a %count% ans</target>
</trans-unit>
<trans-unit id="diff.ago.month">
<source>diff.ago.month</source>
@duboiss
duboiss / index.php
Last active October 4, 2019 11:51
Laragon homepage
<?php
setlocale(LC_ALL, "fr_FR");
if (!empty($_GET['q'])) {
switch ($_GET['q']) {
case 'info':
phpinfo();
exit;
break;
}
@duboiss
duboiss / liste.md
Last active April 21, 2021 17:52
PHP Opérateurs de comparaison
@duboiss
duboiss / WSL2.md
Last active March 12, 2021 14:17
A clean install with WSL2 / Ubuntu 20.10 for developers : PHP / Node.js / Rust / Others
@duboiss
duboiss / ZSH.md
Last active February 16, 2022 13:59

.zshrc

cd $ZSH_CUSTOM/plugins &&
git clone https://github.com/djui/alias-tips.git &&
git clone https://github.com/zsh-users/zsh-autosuggestions &&
git clone https://github.com/zsh-users/zsh-syntax-highlighting &&
cd -
@duboiss
duboiss / DateExtension.php
Created November 2, 2020 16:51
Twig DateInterval format filter
<?php
declare(strict_types=1);
namespace App\Twig;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
class DateExtension extends AbstractExtension
@duboiss
duboiss / instructions.md
Created March 5, 2021 10:24
Webpack Encore / Add fetch polyfill for IE11
yarn add whatwg-fetch

// In first entry
.addEntry('app', ['whatwg-fetch', './assets/app.js'])
@duboiss
duboiss / Profile.ps1
Created March 11, 2021 11:51
WSL2 map port to host
```ps
function mapport {
Param(
[parameter(Mandatory=$true)][int]$windowsPort,
[parameter(Mandatory=$true)][int]$wslPort
)
$ip = wsl hostname -I
netsh interface portproxy add v4tov4 listenport=$windowsPort listenaddress=0.0.0.0 connectport=$wslPort connectaddress=$ip
}
@duboiss
duboiss / install.sh
Last active June 19, 2024 20:26
WSL auto install
#!/bin/bash
updatePackages () {
echo "Updating packages"
sudo add-apt-repository ppa:parkmino/nano -y
sudo add-apt-repository ppa:git-core/ppa -y
sudo add-apt-repository ppa:ondrej/php -y
sudo apt update

Update packages

sudo apt update && sudo apt upgrade -y

Update to latest Ubuntu version

sudo nano /etc/update-manager/release-upgrades

Change lts to normal.