Skip to content

Instantly share code, notes, and snippets.

View matyo91's full-sized avatar

Mathieu Ledru matyo91

View GitHub Profile
@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
@seanhandley
seanhandley / docker-compose.yml
Last active June 7, 2024 19:25
How To Set Up Docker For Mac (Mojave) with Native NFS
version: '2'
services:
api:
volumes:
- "nfsmount:${CONTAINER_DIR}"
volumes:
nfsmount:
driver: local
driver_opts:
@simonbs
simonbs / Create Gist.js
Last active May 6, 2024 23:07
Scriptable script for creating a gist.
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: brown; icon-glyph: file-code;
// To use this script, you need to configure an OAuth App on GitHub.
// Follow the instructions on the link below to create your OAuth App.
//
// When you are asked to put in a redirect URL, you should put the URL for running this script in Scriptable. Assuming the name of this script is "Create Gist", the URL is scriptable:///run?scriptName=Create%20Gist
//
// https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/
//
@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');
@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
@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 / 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;