Skip to content

Instantly share code, notes, and snippets.

View MarionLeHerisson's full-sized avatar

Marion Hurteau MarionLeHerisson

View GitHub Profile
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/meh/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@MarionLeHerisson
MarionLeHerisson / helloWorld.php
Last active March 10, 2020 15:23
Soft. Arch. Heuristics - Exercice 3 : smart Hello World
/** @Route("helloworld-{name} */
public function helloWorldAction($name)
{
$now = date('H');
if ($now >= 6 && $now < 12) {
die('Good morning ' . $name . '!');
}
else if ($now >= 12 && $now < 20) {
die ('Good afternoon ' . $name . '!');
@MarionLeHerisson
MarionLeHerisson / Pricing.cs
Last active March 10, 2020 11:29
Soft. Arch. Heuristics - Exercice 2 : refacto
namespace RCorpFoodPricer
{
using System;
global PLATE_TYPE = "assiette";
global SANDWICH_TYPE = "sandwich";
global LARGE_SIZE = "grand";
global MEDIUM_SIZE = "moyen";
global SMALL_SIZE = "petit";
global NORMAL_DESSERT = "normal";
@MarionLeHerisson
MarionLeHerisson / Exercice 1 - modélisation
Last active March 9, 2020 15:12
Software architecture heuristics - Exercice 1 : modélisation
class Product {
int $id;
string $name;
function isAvailable(): bool
{
}
}
class Customer {
@MarionLeHerisson
MarionLeHerisson / footnote_regexp.md
Created April 17, 2019 12:36
This regex was so cool I had to save it somewhere

This is a regexp to catch footnotes in an article.

/(?=(\[\^(\w*)\])[^:].*(\1:)(.*)(\[\^|$))/Usg

Si nous prenons l'exemple de Wordpress, voici ce qui est dit sur la recherche[^1] :

Ce n'est pas exactement ce que j'appellerai une "killer search". Tous les mots écrits peuvent être recherchés, mais grâce a une simple requête *LIKE*[^2] :

<img src="/media/original/2013/11/realistic.png" class="right" alt="ElasticSearch logo" />ElasticSearch est un logiciel champion du buzzword bingo[^3] :