Skip to content

Instantly share code, notes, and snippets.

View MushuLeDragon's full-sized avatar
🐉
On Fire

MushuLeDragon MushuLeDragon

🐉
On Fire
View GitHub Profile
import dotenv from 'dotenv';
dotenv.config();
const params = {
username: process.env.DATABASE_USERNAME,
password: process.env.PASSWORD,
host: process.env.HOST,
port: process.env.PORT,
databaseName: process.env.DATABASENAME,
@MushuLeDragon
MushuLeDragon / hostinger.md
Last active May 29, 2024 15:11
Deploy on Hostinger

Host on HOSTINGER

Connect to git and deploy the repository

  • Websites > Manage > Advanced (sidebar) > GIT > Generate SSH
  • Copy SSH key to your favorite git orchestrator
  • Create a new repository on Hostinger
    • Repository: Git repository SSH URL
    • Branch: Name of the branch you want to copy
@MushuLeDragon
MushuLeDragon / $Makefile
Last active April 9, 2024 12:10
Makefile to execute docker commands in your project + .env.local.example
include .env.local
project_name=${PROJECT_NAME}
apache:
docker exec -it ${PROJECT_NAME}_apache bash
php:
docker exec -it ${PROJECT_NAME}_php bash
db:
@MushuLeDragon
MushuLeDragon / History|-10aa25a8|entries.json
Last active September 5, 2022 14:37
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/mushu/development/personal/tuto-symfony-lior-docker/.gitignore","entries":[{"id":"rG2a","timestamp":1660652029008}]}
@MushuLeDragon
MushuLeDragon / .bash_aliases
Last active March 13, 2024 15:19
Create aliases. First, enable .bash_aliases file in .bashrc. See https://doc.ubuntu-fr.org/alias
# sudo nano ~/.bash_aliases
# sudo nano ~./bashrc
# source ~/.bashrc
# For macOs
# nano ~/.bash_profile
# source ~/.zshrc
# source ~/.bashrc
@MushuLeDragon
MushuLeDragon / hosts
Created January 20, 2022 08:35
Example of Vhosts configuration for apache2
127.0.0.1 mywebsite.lan
::1 mywebsite.lan
127.0.0.1 example.lan
::1 example.lan
@MushuLeDragon
MushuLeDragon / WSL2.md
Last active January 24, 2022 09:47
Install WSL2 Linux

Installer WSL2 pour Windows 10

Ajouter une connexion au lecteur réseau pour la distribution

Ce PC > Connecter un lecteur réseau > Choisir le lecteur > Ajouter la distribution dans le champs Dossier : \\wsl$\ubuntu

Packages à installer la première fois

@MushuLeDragon
MushuLeDragon / calculatePrice.php
Created September 24, 2021 07:19
Calculate Prestashop prices
<?php
/**
* Paiement
*
* Prix TTC = Prix HT + TVA
* Prix HT = Prix TTC / (1 + taux de TVA)
*
* total_paid = Prix TTC
* total_paid_tax_incl = Prix TTC
@MushuLeDragon
MushuLeDragon / AjaxInputResearchController.php
Created June 4, 2021 09:00
JS / Ajax research for input suggestion
<?php
class ClassController extends Controller
{
public function list_professions(Request $request)
{
$em = $this->container->get('doctrine')->getManager();
$type = $request->request->get('type');
$profession_libelle = $request->request->get('profession_libelle');
# Deny access to filenames starting with dot(.)
<FilesMatch "^\.">
Order allow,deny
Deny from all
</FilesMatch>