Skip to content

Instantly share code, notes, and snippets.

View mascot27's full-sized avatar
:dependabot:

Corentin ZELLER mascot27

:dependabot:
View GitHub Profile
@mascot27
mascot27 / docker-compose.yml
Created November 17, 2021 17:29
Run mysql docker Mac M1 (ARM)
version: '3'
services:
mysql:
container_name: sqlAmt
image: mysql/mysql-server:8.0.23
ports:
- '3306:3306'
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
@mascot27
mascot27 / fold_ideas.md
Created January 20, 2021 10:34 — forked from CMCDragonkai/fold_ideas.md
Haskell: Foldl vs Foldr

Foldl vs Foldr

I like to call foldr as "fold from the right", while foldl is "fold from the left".

@mascot27
mascot27 / self-signed-certificate-with-custom-ca.md
Created September 4, 2020 12:49 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@mascot27
mascot27 / java_example_enum.java
Last active January 18, 2020 14:53
enum usage
package com.company;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;
enum Letter {
RougeVif,
Mauve,
typedef std::chrono::high_resolution_clock Clock;
typedef std::chrono::milliseconds milliseconds;
Clock::time_point tAvantChargement = Clock::now();
milliseconds ms = std::chrono::duration_cast<milliseconds>(tApresChargement - tAvantChargement);
std::cout << "temps de chargement du dictionnaire: " << ms.count() << "ms\n";
@mascot27
mascot27 / exercice1.c
Created June 20, 2018 15:05
te2-INF2 - correction
#include <stdio.h>
#include <stdlib.h>
int main() {
// déclarations:
double x = 12.35;
int i = 123;
char c = 'a';
int* pt = &i;
cv::CascadeClassifier face_cascade;
face_cascade.load("C:/OpenCV-3.2.0/opencv/sources/data/haarcascades/haarcascade_frontalface_alt2.xml");
std::vector<cv::Rect> faces;
face_cascade.detectMultiScale(frame, faces, 1.1, 2, 0|CV_HAAR_SCALE_IMAGE, cv::Size(30, 30) );
// Draw circles on the detected faces
for( int i = 0; i < faces.size(); i++ ){
cv::Point center( faces[i].x + faces[i].width*0.5, faces[i].y + faces[i].height*0.5 );
cv::ellipse( frame, center, cv::Size( faces[i].width*0.5, faces[i].height*0.5), 0, 0, 360, cv::Scalar( 255, 0, 255 ), 4, 8, 0 );
}
@mascot27
mascot27 / python_3_email_with_attachment.py
Created October 27, 2017 11:37 — forked from rdempsey/python_3_email_with_attachment.py
Use Python 3 to send an email with an attachment using Gmail
#!/usr/bin/env python
# encoding: utf-8
"""
python_3_email_with_attachment.py
Created by Robert Dempsey on 12/6/14.
Copyright (c) 2014 Robert Dempsey. Use at your own peril.
This script works with Python 3.x
NOTE: replace values in ALL CAPS with your own values
from PIL import ImageGrab
import numpy as np
import matplotlib.pyplot as plt
import cv2
import time
import pyautogui
print("launched")
time.sleep(2)
@mascot27
mascot27 / mysql_secure.sh
Created April 24, 2017 14:09 — forked from Mins/mysql_secure.sh
Automating mysql_secure_installation
#!/bin/bash
aptitude -y install expect
// Not required in actual script
MYSQL_ROOT_PASSWORD=abcd1234
SECURE_MYSQL=$(expect -c "
set timeout 10