Skip to content

Instantly share code, notes, and snippets.

View felixdorn's full-sized avatar

Félix Dorn felixdorn

View GitHub Profile
<?php
require '../vendor/autoload.php';
$Directory = new RecursiveDirectoryIterator(__DIR__ . '\svg');
$Iterator = new RecursiveIteratorIterator($Directory);
$svgs = new RegexIterator($Iterator, '/^.+\.svg$/i', RecursiveRegexIterator::GET_MATCH);
echo '<pre>';
foreach ($svgs as $svg) {
[$name, $extension] = explode('.', basename($svg[0]));
$content = base64_encode(file_get_contents($svg[0]));
<?php
namespace Felix\Framework\Renderer;
use Felix\Flash\Flasher;
use Tamtamchik\SimpleFlash\Flash;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
<?php
namespace Felix\Framework\Renderer;
use Felix\Flash\Flasher;
use Tamtamchik\SimpleFlash\Flash;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
/**
* @param string $key
* @param string|null $default
* @return string|boolean
*/
function env(string $key, string $default = null)
{
$getKey = static function ($key, $default) {
if (notEmpty(array_get($_SERVER, $key))) {
@felixdorn
felixdorn / docker-setup-scaleway-debian-arm64.sh
Last active December 5, 2019 18:55
Docker Setup Scaleway Debian Arm64
echo "Update packages" &&
sudo apt-get update -y &&
echo "Removing old docker versions" &&
sudo apt-get remove docker docker-engine docker.io containerd runc -y &&
echo "Updating packages" &&
sudo apt-get update -y &&
echo "Installing packages to allow apt to use a repository over HTTPS" &&
sudo apt-get install \
apt-transport-https \
ca-certificates \
{
"13th": {
"form": "13th",
"wordnet_id": "a-02203763",
"pos": "JJ",
"sense": "coming next after the twelfth in position",
"polarity": "0.0",
"subjectivity": "0.0",
"intensity": "1.0",
"confidence": "0.9"

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@felixdorn
felixdorn / .htacess
Created February 25, 2020 15:06
Laravel htacess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
<?php
require __DIR__ . '/../vendor/autoload.php';
error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
$payload = file_get_contents('php://input');
[
{
"name": "Omolon",
"colors": ["#091E3A", "#2F80ED", "#2D9EE0"]
},
{
"name": "Farhan",
"colors": ["#9400D3", "#4B0082"]
},
{