Skip to content

Instantly share code, notes, and snippets.

View mdevoldere's full-sized avatar
👁️‍🗨️

MDevoldere mdevoldere

👁️‍🗨️
View GitHub Profile
Alias /dwwm2304 "C:/Users/mdevoldere/Documents/GitHub/DWWM_2304-PHP/"
<Directory "C:/Users/mdevoldere/Documents/GitHub/DWWM_2304-PHP/">
AllowOverride all
Options +Indexes +FollowSymLinks
Require all granted
</Directory>
@mdevoldere
mdevoldere / composer-github-vcs.json
Created October 15, 2023 09:18
Composer require git repos
{
"name": "mdevoldere/Repo",
"description": "A simple Repo for educationnal purposes",
"type": "library",
"version": "1.0.0",
"minimum-stability": "dev",
"license": "GPL-3.0-or-later",
"authors": [
{
"name": "MDevoldere",
@mdevoldere
mdevoldere / launch.json
Last active November 9, 2022 20:49
PHP8 XDEBUG VSCode
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003
},
{
@mdevoldere
mdevoldere / jekyll-and-liquid.md
Created March 27, 2022 13:09 — forked from magicznyleszek/jekyll-and-liquid.md
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@mdevoldere
mdevoldere / update-jekyll
Created January 23, 2021 21:15 — forked from grant-roy/update-jekyll
Bash script to poll Github and rebuild and restart a jekyll site
#!/bin/sh
#This is a simple bash script that will poll github for changes to your repo,
#if found pull them down, and then rebuild and restart a Jekyll site running
#in Nginx. Note, we cannot use cron to schedule a job every 5 seconds, so we create
#a script that executes an infinite loop that sleeps every 5 seconds
#We run the script with nohup so it executes as a background process: $nohup ./update-jekyll
while true
do
@mdevoldere
mdevoldere / Route.php
Created February 9, 2020 10:18
PHP: Simple router
<?php
/*
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !favicon.ico$
RewriteRule ^([a-z,A-Z,0-9,-]+)([/]*)$ /index.php?url=$1 [QSA,L]
*/
class Route
{
@mdevoldere
mdevoldere / Db.php
Last active February 9, 2020 10:14
PHP: Interaction avec PDO
<?php
/**
* La classe Db permet d'interagir avec une connexion PDO
*
* - Initialisation d'instances PDO mysql ou sqlite via ses méthodes statiques
* - Requêtage sur une connexion PDO via ses méthodes d'instance
*
*
* // Exemple d'utilisation (initialisation d'une instance)
@mdevoldere
mdevoldere / HashExtensions.cs
Created August 23, 2019 16:22
String Hash Extensions
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;
using System.Diagnostics;
namespace Tedi
{
public async void Listen()
{
try
{
string Ip = "127.0.0.1";
int Port = 80;
using (HttpListener srv = new HttpListener())
{
srv.Prefixes.Clear();
@mdevoldere
mdevoldere / .htaccess
Created October 29, 2018 17:33
Apache 2.4 Htaccess basic
# Enable DEFLATE output
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript
# Check if mod_headers is enabled
<IfModule mod_headers.c>
#CORSify for everyone
Header set Access-Control-Allow-Origin "*"
# Cache Control for assets