Skip to content

Instantly share code, notes, and snippets.

View pocky's full-sized avatar
🐿️
code code code

Alexandre Balmes pocky

🐿️
code code code
View GitHub Profile
@pocky
pocky / argument.php
Created February 14, 2014 10:32
Pseudo-Named Argument in PHP (this is a bad idea because you loose type hinting)
<?php
class Foo {
public static function getBar($args)
{
$args += [
'foo' => null,
'bar' => false,
'baz' => null
@pocky
pocky / php.ini
Created June 4, 2014 00:27
ubuntu
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@pocky
pocky / keybase.md
Created February 14, 2015 13:58
keybase.md

Keybase proof

I hereby claim:

  • I am pocky on github.
  • I am pocky (https://keybase.io/pocky) on keybase.
  • I have a public key whose fingerprint is 00C9 A1DE E030 9838 7341 0901 3F70 833B 886B A122

To claim this, I am signing this object:

<?php
/**
* Class Holidays
*/
class Holidays
{
/**
* @var array
*/
@pocky
pocky / cleandb.php
Created August 11, 2015 17:01
HtmlPurifier for word/wordpress (assuming files are in a direct subdirectory of Wordpress root path)
<?php
include('../wp-load.php');
include('vendor/autoload.php');
$config = \Symfony\Component\Yaml\Yaml::parse(file_get_contents('config.yml'));
$purifier_config = HTMLPurifier_Config::createDefault();
foreach ($config as $k => $v) {
$purifier_config->set($k, $v);
@pocky
pocky / InMemoryRepository.php
Created November 19, 2015 23:32
DDD => CQRS
<?php
namespace Infrastructure\Website\Persistence;
use Domain\Website\Entity\Website;
use Domain\Website\ValueObject\WebsiteId;
use Domain\Website\Repository\WebsiteRepository;
class InMemoryRepository implements WebsiteRepository
{
@pocky
pocky / form.fr.yml
Last active December 24, 2015 02:19
Bug inside ?
tick:
child:
age:
label: Age de l'enfant
choices:
2: De 0 à 2 ans
310: De 3 à 10 ans
# Output -> Age de l'enfant
# Output -> De 0 à 2 ans
@pocky
pocky / response.json
Last active December 24, 2015 10:39
Amusez toi bien avec du JSON + Typehead
{
"52498eea8ead0ec0230041a7":{"id":"52498eea8ead0ec0230041a7","name":"Les appareils de chauffage \u00e9lectrique moderne","slug":"les-appareils-de-chauffage-electrique-moderne","type":"page"},
"52498f0e8ead0ec5200041a8":{"id":"52498f0e8ead0ec5200041a8","name":"Les technologies utilis\u00e9es","slug":"les-technologies-utilisees","type":"page"},
"52498f2c8ead0ec0230041a8":{"id":"52498f2c8ead0ec0230041a8","name":"Les normes applicables","slug":"les-normes-applicables","type":"page"},
"52498f4a8ead0e7b220041a8":{"id":"52498f4a8ead0e7b220041a8","name":"Confort thermique","slug":"confort-thermique","type":"page"},
"52498f8b8ead0ec5200041a9":{"id":"52498f8b8ead0ec5200041a9","name":"Propret\u00e9 de l'air","slug":"proprete-de-l-air","type":"page"},
"52498fa88ead0ec0230041a9":{"id":"52498fa88ead0ec0230041a9","name":"Souplesse et adaptabilit\u00e9","slug":"souplesse-et-adaptabilite","type":"page"},
"52498fc28ead0e7b220041a9":{"id":"52498fc28ead0e7b220041a9","name":"Simplicit\u00e9 d'utilisation","slug":"s
@pocky
pocky / output.txt
Created July 13, 2016 23:34
docker pi-cluster
docker info  01:30:22
Containers: 3
Running: 3
Paused: 0
Stopped: 0
Images: 9
Server Version: swarm/1.2.3
Role: primary
Strategy: spread
Filters: health, port, containerslots, dependency, affinity, constraint
@pocky
pocky / genesis_public_key
Created February 8, 2018 14:03
genesis_public_key
04108239d89ff5fb16229c83007895d9846cb167adee6c58f2515048e7ad13af28c743cf2717049cf70c8decc2e951bc36469cf9826d67c7ac8a373568b0f72191