Skip to content

Instantly share code, notes, and snippets.

View mangelsnc's full-sized avatar
☠️
Coding at @secture

Miguel Ángel Sánchez Chordi mangelsnc

☠️
Coding at @secture
View GitHub Profile
<?php declare(strict_types=1);
namespace App\Strategy;
class FormatContext
{
private $strategy;
private $message;
public function setStrategy(Strategy $strategy): void
@mangelsnc
mangelsnc / EmailService.php
Created August 28, 2019 08:06
Without Demeter
<?php declare(strict_types=1);
interface EmailService
{
public function sendEmail(Email $email): void;
}
@mangelsnc
mangelsnc / gist:d8249b25bf8e0844ee01a9fc81ec8834
Created March 15, 2019 11:17 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@mangelsnc
mangelsnc / paises.csv
Created April 26, 2018 09:28 — forked from brenes/README.md
CSV de paises, con nombre en castellano, ingles, codigo ISO y prefijo telefónico del país
nombre name nom iso2 iso3 phone_code
Afganistán Afghanistan Afghanistan AF AFG 93
Albania Albania Albanie AL ALB 355
Alemania Germany Allemagne DE DEU 49
Algeria Algeria Algérie DZ DZA 213
Andorra Andorra Andorra AD AND 376
Angola Angola Angola AO AGO 244
Anguila Anguilla Anguilla AI AIA 1 264
Antártida Antarctica L'Antarctique AQ ATA 672
Antigua y Barbuda Antigua and Barbuda Antigua et Barbuda AG ATG 1 268
@mangelsnc
mangelsnc / generate-cert.sh
Created March 15, 2018 09:15
Autogenerated SSL Wildcard certificate
cat > openssl.cnf <<-EOF
[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no
[req_distinguished_name]
CN = *.domain.dev
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
@mangelsnc
mangelsnc / roman-numerals.md
Last active August 25, 2017 06:42
Katas Statements

Roman Numerals Kata

The Romans were a clever bunch. They conquered most of Europe and ruled it for hundreds of years. They invented concrete and straight roads and even bikinis. One thing they never discovered though was the number zero. This made writing and dating extensive histories of their exploits slightly more challenging, but the system of numbers they came up with is still in use today. For example the BBC uses Roman numerals to date their programmes.

The Romans wrote numbers using letters - I, V, X, L, C, D, M. (notice these letters have lots of straight lines and are hence easy to hack into stone tablets)

The Kata says you should write a function to convert from normal numbers to Roman Numerals:

1 --&gt; I