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 / STREAMDECK_HID.md
Created January 6, 2024 11:52 — forked from cliffrowley/STREAMDECK_HID.md
Notes on the Stream Deck HID protocol

Stream Deck Protocol

How to interface with a Stream Deck device.

Synopsis

The device uses the HID protocol to communicate with its software.

Configuration

@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

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};
<?php
class Collection<T>
{
private T[] $items = [];
public function add(T $item): void
{
$this->items[] = $item;
}
name: CI
on: [push]
jobs:
test-php:
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.3, 7.4]

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:

@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 %}
@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 / 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 / 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