Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Machou Machou

🏠
Working from home
  • Arround The World !
View GitHub Profile
View Cheat.Bash.md

Gestion des Clés GPG

  1. Installer dirmngr

sudo apt-get install dirmngr --install-recommends

  1. Installer les dépendances

sudo apt-get install apt-transport-https

View Cheats.md

Cheats

Divers : https://pastebin.com/dxZi1BxM

Installer PHP 7 / 8

sudo touch /etc/apt/sources.list.d/sury-php.list && sudo nano /etc/apt/sources.list.d/sury-php.list
View Cheat.Git.md

Git Cheat

Cloner une branch spécifique

  1. Cloner la branche souhaitée

git clone --branch nom_branch url_depot

  1. Direction le répertoire de la branche clonée précédemment
View Retour_vers_le_futur.php
<?php
$presentTime = new DateTime('2020-11-9 18:25');
$destinationTime = new DateTime('2021-11-9 18:25');
echo 'Date de destination : ' . $destinationTime->format('M d Y A h:i') . '<br>';
echo 'Date actuelle ' . $presentTime->format('M d Y A h:i') . '<br>';
$diff = $presentTime->diff($destinationTime);
echo 'Différence ( en secondes ) : ' . $totalMinutes = $diff->format('%a') * 365 * 24 * 60 * 60 . '<br>';
echo 'Différence ( en minutes ) : ' . $totalMinutes = $diff->format('%a') * 365 * 24 * 60;
View request.http
# POST add urlencoded
POST https://http-practice.herokuapp.com/wilders
Content-Type: application/x-www-form-urlencoded
name=John%20Doe&language=C%23
# POST JSON
POST https://http-practice.herokuapp.com/wilders
Content-Type: application/json
View MilesToKm.php
<?php
class Speedometer {
const MILES = 1.609;
public static function convertKmToMiles(float $unit): float
{
return self::MILES / $unit;
}
View Easters Eggs
Homme qui court
curl ascii.live/forrest
Perrotquet
curl parrot.live
Petit Train
apt install sl && sl
Matrix
@Machou
Machou / latency.markdown
Created Jan 13, 2020 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know
View latency.markdown

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns  = 250 µs
@Machou
Machou / dump.php
Created Jan 8, 2020
Simple script PHP pour exporter votre base de données SQL
View dump.php
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
// Le fichier où doit se sauvegarder la base de données
$dump = dirname(__FILE__) . '/dump.sql';
// L'adresse de la base de données
$db_host = '';
// Le nom d'utilisateur
You can’t perform that action at this time.