Skip to content

Instantly share code, notes, and snippets.

View JanLaureys's full-sized avatar

Jan Laureys JanLaureys

  • BRAVAS BV
  • Antwerpen
View GitHub Profile
@kunicmarko20
kunicmarko20 / LocaleListener.php
Last active December 23, 2022 03:59
Symfony Locale Listener that redirects to default language route if no language has been added instead of 404
<?php
namespace YourBundle\EventListener;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Routing\Matcher\UrlMatcher;
use Symfony\Component\Routing\RequestContext;
@kalmanolah
kalmanolah / haste.py
Last active December 8, 2021 21:47
Simple python script for putting things on hastebin. The resulting hastebin URL is copied to your primary clipboard using xsel. Usage: `cat yourfile.txt | haste`, `haste yourfile.txt`, 'haste` or `haste --clip`. `haste --help` for help.
#!/usr/bin/env python3
# @python3
# @author Kalman Olah <hello@kalmanolah.net>
"""A hastebin CLI tool."""
import click
import json
import requests
import subprocess
import sys