Skip to content

Instantly share code, notes, and snippets.

@roukmoute
roukmoute / Exception.php
Last active August 30, 2016 16:58
Exception with possibility to use a formatted string
<?php
namespace Exception;
class Exception extends \Exception
{
/**
* @param string $message
* @param string|array $arguments
* @param int $code
* @param Exception|null $previous
@roukmoute
roukmoute / EntityRepository.php
Last active October 8, 2024 00:29
Concrete example of WHERE...IN subquery in doctrine 2
<?php
class MyRepository extends EntityRepository
{
public function whereInSubQuery(User $user)
{
$queryBuilder = $this->createQueryBuilder('my_repository');
$queryBuilder
->where(
$queryBuilder->expr()->in(
@roukmoute
roukmoute / keybase.md
Created September 7, 2017 10:13
public identity on keybase

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@roukmoute
roukmoute / update date time
Last active December 27, 2018 12:31
update date time
sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
@roukmoute
roukmoute / recipes.txt
Last active August 29, 2019 22:40
uMatrix
! uMatrix: Ruleset recipes 1.0
! Title: Rulesets for Roukmoute websites
! Maintainer: Roukmoute
!
! Lines starting with character "!" are ignored.
! Character "_" is an alias for "currently selected scope".
! An empty line MUST be used to separate distinct ruleset recipes.
Crunchyroll
@roukmoute
roukmoute / Terminal
Last active April 21, 2019 15:36
Issue to clone a repository on Manjaro
[roukmoute@roukmoute-pc ~]$ eval $(ssh-agent)
Agent pid 1086
[roukmoute@roukmoute-pc ~]$ git clone [email protected]:roukmoute/dotfiles.git
Cloning into 'dotfiles'...
Enter passphrase for key '/home/roukmoute/.ssh/id_rsa':
packet_write_wait: Connection to 140.82.118.3 port 22: Broken pipe
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
@roukmoute
roukmoute / error.sh
Last active August 30, 2019 14:08
TAOP - Makefile - Import segfault
[postgres@roukmoute-pc TheArtOfPostgreSQL]$ make
createuser -SDr taop
createdb -O taop taop
psql -d taop -c 'create extension btree_gist'
CREATE EXTENSION
psql -d taop -c 'create extension ip4r'
CREATE EXTENSION
psql -d taop -c 'create extension hll'
CREATE EXTENSION
psql -d taop -c 'create extension cube'
@roukmoute
roukmoute / import.sh
Created September 18, 2019 11:47
TAOP - Import
[postgres@roukmoute-pc TheArtOfPostgreSQL]$ make dropdb
dropdb --if-exists taop
dropuser --if-exists taop
[postgres@roukmoute-pc TheArtOfPostgreSQL]$ make
createuser -SDr taop
createdb -O taop taop
psql -d taop -c 'create extension btree_gist'
CREATE EXTENSION
psql -d taop -c 'create extension ip4r'
CREATE EXTENSION
@roukmoute
roukmoute / TokenProvider.php
Created June 2, 2020 11:09
Generate a random token using /dev/random
<?php
declare(strict_types=1);
namespace App;
class TokenProvider
{
const RANDOM_COMPAT_READ_BUFFER = 8;
@roukmoute
roukmoute / gist:b7d5021826042ff537e7090a61ec5df7
Created June 30, 2020 10:36
Avatarify installation problem
Clonage dans 'v4l2loopback'...
--- Installing v4l2loopback (sudo privelege required)
Building v4l2-loopback driver...
make -C /lib/modules/`uname -r`/build M=/home/roukmoute/workspace/avatarify/v4l2loopback modules
make[1] : on entre dans le répertoire « /usr/lib/modules/5.4.44-1-MANJARO/build »
CC [M] /home/roukmoute/workspace/avatarify/v4l2loopback/v4l2loopback.o
Building modules, stage 2.
MODPOST 1 modules
CC [M] /home/roukmoute/workspace/avatarify/v4l2loopback/v4l2loopback.mod.o
LD [M] /home/roukmoute/workspace/avatarify/v4l2loopback/v4l2loopback.ko