Skip to content

Instantly share code, notes, and snippets.

View matyo91's full-sized avatar

Mathieu Ledru matyo91

View GitHub Profile
@Ocramius
Ocramius / compiler-pass.php
Last active March 16, 2020 07:07
Compiler pass to declare a repository as service for each declared doctrine entity in a symfony application
<?php
final class RegisterRepositoriesForAllEntitiesPass implements CompilerPassInterface
{
/** {@inheritdoc} */
public function process(ContainerBuilder $container)
{
/** @var MappingDriver $metadata */
$metadata = $container->get($this->mappingDriverServiceName());
$entityManagerReference = new Reference('doctrine.orm.entity_manager');
.
|-- 24-7 Hardcore
| |-- [247HC051] Stars Collide Remix EP
| | |-- 01. [10B] Al Storm Ft. Taya - Stars Collide (Chaos Remix).mp3
| | |-- 02. [10B] Al Storm Ft. Taya - Stars Collide (Essex Boyz vs Al Storm 'Hardcore' Mix).mp3
| | |-- 03. [10B] Al Storm Ft. Taya - Stars Collide (Essex Boyz vs Al Storm 'Bounce' Mix).mp3
| | |-- 04. [10B] Al Storm Ft. Taya - Stars Collide (Exclusive Intro Mix).mp3
| | `-- 05. [10A] Al Storm Ft. Taya - Stars Collide (Original Mix).mp3
| `-- [+singles]
| |-- [247FREE001] [6A] Candee Jay - If I Were You (Al Storm Remix).mp3
@Pierstoval
Pierstoval / Makefile
Last active March 2, 2021 14:38
"Check requirements" command for your Makefile
# Use it like this:
#
# $ printf $(_TITLE) "Something in green" "The message"
#
# This will output something like this:
#
# [Something in green] The message
#
# (of course, with proper colors)
_TITLE := "\033[32m[%s]\033[0m %s\n" # Green text
@roblabs
roblabs / generateAppIcon.sh
Last active May 28, 2022 12:11 — forked from benvium/generateAppIcon.sh
Generate app icons and xcassets file from a single image. To use this, place script in `appname` folder inside your project (i.e. the folder that Xcode generates for you containing your source code, it's named after whatever you called the app). Create folder there called `RawImages`. Source icon should 1024x1024 and be called appIcon.png. If th…
#!/bin/bash -e
# --------------------------------------------------------
# Generate app icons and xcassets file from a single image
# Ben Clayton, Calvium Ltd.
# https://gist.github.com/benvium/2be6d673aa9ac284bb8a
# --------------------------------------------------------
#
# Usage with an input of 1024x1024 PNG file
# generateAppIcon.sh AppIcon.png
@stigok
stigok / githook.js
Last active July 30, 2023 09:46
Verify GitHub webhook signature header in Node.js
/*
* Verify GitHub webhook signature header in Node.js
* Written by stigok and others (see gist link for contributor comments)
* https://gist.github.com/stigok/57d075c1cf2a609cb758898c0b202428
* Licensed CC0 1.0 Universal
*/
const crypto = require('crypto')
const express = require('express')
const bodyParser = require('body-parser')
@tskaggs
tskaggs / OSX-Convert-MOV-GIF.md
Last active October 9, 2023 12:15
Creating GIFs from .MOV files in OSX using FFmpeg and ImageMagick

Convert MOV to GIF using FFmpeg and ImageMagick

I tried a few different techniques to make a GIF via command-line and the following gives me the best control of quality and size. Once you're all setup, you'll be pumping out GIFs in no time!

Preparation

Install FFmpeg

  • $ brew install ffmpeg [all your options]
    • Example: $ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

Install ImageMagick

@Glideh
Glideh / postman-prerequest-login.js
Last active November 9, 2023 08:49
Postman pre-request script to get a JWT if needed
/** Checks if the JWT is present and not expired
The token is expected to be found in `token` environment variable
*/
function isValidToken() {
const token = pm.environment.get("token");
if (!token) {
console.log("Token is missing");
return false;
}
// Payload is retrieved after JSON parsing the base64 decoded `atob()` 2nd part of the JWT `[1]`
@lyrixx
lyrixx / run.php
Last active November 9, 2023 13:51
Updated your templates with the new twig include
<?php
<<<CONFIG
packages:
- "symfony/finder: ~3.0"
- "symfony/console: ~3.0"
CONFIG;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
@lyrixx
lyrixx / test.php
Last active November 10, 2023 14:27
Symfony Playgound with its Container and a custom configuration
<?php
use App\Kernel;
require __DIR__.'/vendor/autoload_runtime.php';
use Symfony\Component\Console\Output\StreamOutput;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

Music Naming Conventions

This document specifies the naming conventions for my DJ music collection. This includes formatting for ID3 tags as well as directory structure and file naming conventions.

Track file types

All music must be either a 320kbs MP3 or a 16bit or 24bit unsigned PCM stream stored in a AIFF file. Both of these files are commonly readable by