Skip to content

Instantly share code, notes, and snippets.

View Swop's full-sized avatar
👨‍💻

Sylvain MAUDUIT Swop

👨‍💻
View GitHub Profile
<?php
/*
* CLI report.
*/
$stdOutWriter = new \mageekguy\atoum\writers\std\out();
$cli = new \mageekguy\atoum\reports\realtime\cli();
$cli->addWriter($stdOutWriter);
/*
@tarex
tarex / gist:3683635
Created September 9, 2012 10:13 — forked from saetia/gist:1623487
Clean Install – Mountain Lion OS X 10.8
@ludofleury
ludofleury / getset.sublime-snippet
Created February 15, 2013 02:25
PHP (Symfony) oriented getter-setter snippet for Sublime Text
<snippet>
<content><![CDATA[
/**
* Get $1
*
* @return ${2:[type]} \$$1
*/
public function get${1/(.*)/\u$1/}()
{
return \$this->${1:$SELECTION};
@0gust1
0gust1 / default_config.js
Last active November 17, 2016 15:58
Usable and flexible Gruntfile modularization ?
module.exports = function(grunt, env) {
var defaults = config = {
//Write here your configuration , grunt style, in the standard way
//Extract informations from package.json
pkg: grunt.file.readJSON('package.json'),
//Define a global banner
@everzet
everzet / RethrowExceptionListener.php
Last active February 27, 2017 12:18
Rethrow non-HTTP exceptions in the test environment (aka functional tester saver)
<?php
namespace App\EventListener;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
class ExceptionRethrowListener
{
public function onKernelException(GetResponseForExceptionEvent $event)
@antfroger
antfroger / forum_php_2014.md
Last active October 21, 2017 12:53
Forum PHP 2014
@omz
omz / iTC Downloader.py
Created July 29, 2013 23:35
iTC Downloader
# -*- coding: utf-8 -*-
# iTC Sales Report Downloader
# When you run this for the first time, you'll need to enter your
# iTunes Connect login and vendor ID. You can find the vendor ID
# on the iTunes Connect website by navigating to "Sales and Trends";
# it's the number next to your name (top-left).
CURRENCY = 'EUR'
RESET_LOGIN = False # Set to True to remove login from keychain
@jaytaph
jaytaph / checktoken.php
Created July 6, 2012 19:41
Varnish oauth offloader
<?php
// Crude check. Off course this should be stored in a (memory) database. $token is an
// access token that is provided by oauth.
$token = $_SERVER['HTTP_X_AUTH_TOKEN'];
if ($token == "mellon") {
header("X-Api-User: Gandalf");
header("X-Api-Context: Middle-Earth");
header("Cache-Control: public, max-age=120");
anonymous
anonymous / amazon.md
Created August 19, 2015 18:34

I would like to tell my story of burnout at Amazon, considering the fact that there is so many stories out there on both sides of the issue. My story is also on both sides of the issue, and I've had a lot of time to think about why people can see the same culture but come away with completely different conclusions. This is a throwaway because I still work there and I don't plan on changing that, and I don't exactly trust the company to take this in good faith, despite the fact that I mean this as a purely constructive criticism for a company that I really do like.

I am an autodidact (my formal education only tangentially describes what I can do), and a polymath (capable of holding my own amongst PhD-level Operations Researchers, Statisticians, Econometricians, Data Scientists, Computer Scientists, as well as Software Engineers). I love to solve real world problems, and in many ways am the perfect type of person for Amazon's culture. I started in a level 5 position, but felt from the beginning that I warrant

@igorw
igorw / php-lazy-seq.php
Last active August 23, 2021 16:47
Lazy sequences using PHP 5.5 generators.
<?php
// thanks to metaultralurker on reddit for inspiration
function map(callable $fn, \Traversable $data) {
foreach ($data as $v) {
yield $fn($v);
}
}