Skip to content

Instantly share code, notes, and snippets.

View jderusse's full-sized avatar

Jérémy Derussé jderusse

View GitHub Profile
@jderusse
jderusse / CanceledException.php
Created June 3, 2019 12:23
Cancelable HttpClient
<?php
namespace App\HttpClient;
class CanceledException extends \RuntimeException
{
}
@jderusse
jderusse / script.js
Created January 25, 2018 07:14
Async document.writeln
const evalCode = (code) => {
const oldWrite = document.writeln;
const sandbox = document.createElement('div');
document.body.appendChild(sandbox);
document.writeln = (content) => {
sandbox.innerHTML += content;
};
try {
(window.execScript || function(data) {

Keybase proof

I hereby claim:

  • I am jderusse on github.
  • I am jderusse (https://keybase.io/jderusse) on keybase.
  • I have a public key ASBN2fFf5AAiK4BjmcqiGYMjlDec0jJhIEEH4D78hmoVLQo

To claim this, I am signing this object:

@jderusse
jderusse / .gitconfig
Created July 7, 2015 08:42
My git config
[user]
name = Jérémy Derussé
email = jeremy@derusse.com
[push]
default = simple
[alias]
st = status
ci = commit
@jderusse
jderusse / .DockerDNS.md
Last active August 29, 2015 14:16
Docker DNS

Build

docker build --rm -t dns PATH_TO_DOCKERFILE
chmod +x dns.sh
mkdir -p /opt/docker && sudo mv dns.sh /opt/docker/dns

Run

@jderusse
jderusse / melody-extensions.php
Last active August 29, 2015 14:15
melody-extensions
<?php
<<<CONFIG
packages:
- "nikic/php-parser"
CONFIG;
/**
* Browse the current working directory to search called function.
* Then render the list of functions grouped by extension name.
*
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
use Symfony\Component\ClassLoader\ApcClassLoader;
$env = getenv('SYMFONY_ENV') ?: 'prod';
$debug = getenv('SYMFONY_DEBUG') === '1';
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
<?php
<<<CONFIG
packages:
- "symfony/symfony-installer: *"
CONFIG;
if (PHP_VERSION_ID < 50400) {
file_put_contents('php://stderr', sprintf(
"Symfony Installer requires PHP 5.4 version or higher and your system has\n".
<?php
<<<CONFIG
packages:
- "sensiolabs/security-checker: *"
CONFIG;
use Symfony\Component\Console\Application;
use SensioLabs\Security\Command\SecurityCheckerCommand;
use SensioLabs\Security\SecurityChecker;