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
<?php
// don't forget to run PHP with root
function russian($roulette) {
shuffle($roulette);
$kaboum = $roulette[0];
if (null === $kaboum) {
return 'Try again!';
<?php
declare(strict_types=1);
namespace App\Application\Request\Account;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Exception\ValidatorException;
use Symfony\Component\Validator\Validation;
@pocky
pocky / deletion.rb
Created May 14, 2018 21:34
My Tweet deletion script
#!/usr/bin/env ruby
require "tweet_deletion"
require 'yaml'
config = YAML.load_file('config.yml')
TweetDeletion.with( config ) do
for_archive("./archive/") do
keep_if earlier_than(3.years.ago), tag:" 📅 " # When I was young, I was.
@pocky
pocky / genesis_public_key
Created February 8, 2018 14:03
genesis_public_key
04108239d89ff5fb16229c83007895d9846cb167adee6c58f2515048e7ad13af28c743cf2717049cf70c8decc2e951bc36469cf9826d67c7ac8a373568b0f72191
@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 / 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 / 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);
<?php
/**
* Class Holidays
*/
class Holidays
{
/**
* @var array
*/
@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:

@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: