Skip to content

Instantly share code, notes, and snippets.

View amenophis's full-sized avatar

Jérémy Leherpeur amenophis

View GitHub Profile
@amenophis
amenophis / ControllerAnnotationListener.php
Last active December 31, 2015 01:39
Créer ses annotations
<?php
namespace TataJerem\Bundle\DemoBundle\EventListener;
use Doctrine\Common\Annotations\Reader;
use Doctrine\Common\Util\ClassUtils;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\SecurityContext;
use TataJerem\Bundle\DemoBundle\Annotation\Permissions;
@amenophis
amenophis / AppKernel.php
Last active December 31, 2015 18:59
[Symfony] CRUD avec SyliusResourceBundle
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
@amenophis
amenophis / flashes.twig
Created January 5, 2014 21:34
Symfony flashes twig
{% for label, flashes in app.session.flashbag.all %}
{% for flash in flashes %}
<div class="alert alert-{{ label }}">
{{ flash }}
</div>
{% endfor %}
{% endfor %}

Install OS X 10.10 Yosemite in VirtualBox

(based on this pastebin i've found via Google, markdownified and adjusted to work with the official Yosemite release)

Yosemite's first developer preview was released right after Monday's WWDC opening keynote. For the general public, an open beta will be available to download later this summer. However, for those who want a sneak peek at the new hotness, there is a way to safely install it without risking your machine, using the free and powerful VirtualBox application from Oracle.

(LEGAL DISCLAIMER: This guide aims to explain how to create a virtual machine on a regularly purchased Apple computer, running a genuine Mac OS X operating system, for testing purposes only.)

@amenophis
amenophis / README.md
Last active August 29, 2015 14:24 — forked from chadrien/README.md

Init boot2docker

Create boot2docker instance and start it

$ boot2docker init --dhcp=false --hostip=172.16.0.1
$ boot2docker up

Configure the instance

Keybase proof

I hereby claim:

  • I am amenophis on github.
  • I am amenophis (https://keybase.io/amenophis) on keybase.
  • I have a public key ASDyQY-XEey4iduuPMBl_nCCJy1ilQlrQHiA5CPLxaWO7wo

To claim this, I am signing this object:

name: CI
on: [push]
jobs:
test-php:
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.3, 7.4]
<?php
class Collection<T>
{
private T[] $items = [];
public function add(T $item): void
{
$this->items[] = $item;
}
use std::collections::HashMap;
use std::thread;
use std::thread::sleep;
use std::time::Duration;
use streamdeck::StreamDeck;
const ELGATO_VENDOR_ID: u16 = 0x0fd9;
use rusb::{Context, Device, HotplugBuilder, UsbContext};
@amenophis
amenophis / README.md
Last active October 26, 2022 08:32
htmltopdf with pupeteer and chrome

htmltopdf with pupeteer and chrome

Install

Install project dependencies:

yarn

Start