Skip to content

Instantly share code, notes, and snippets.

@jeroenknoef
jeroenknoef / Controller.kt
Last active September 1, 2021 16:34
Micronaut - KMongo - Jackson
// Example controller
@Controller
@Validated
class DemoBeanController(
private val service: Service // Injected by Micronaut
) {
@Get("/{id}")
// Micronaut 1.3 supports coroutines, this also works in earlier versions.
@sirtony
sirtony / rpa.py
Created May 12, 2017 06:35
RenPy archive unpacker
from pickle import loads as unpickle
from zlib import decompress
from argparse import ArgumentParser
from sys import exit, stderr
import os
def _main():
parser = ArgumentParser( description = "RenPy Arhive (.rpa) unpacker" )
parser.add_argument( "-o", "--output", required = False, type = str, dest = "output", metavar = "dir", help = "The directory to output files to" )
parser.add_argument( "-i", "--input", required = True, type = str, dest = "input", metavar = "path", help = "The archive to unpack" )
@KostyaEsmukov
KostyaEsmukov / _ express-redirect-platform-location.md
Last active October 20, 2023 20:55
HTTP redirects with Angular SSR

HTTP redirects with Angular Server Side Rendering

This service assumes that you followed the SSR receipt at ng-cli (i.e. you use the '@nguniversal/express-engine' package).

@markhowellsmead
markhowellsmead / .htaccess
Last active December 27, 2024 13:59
Detect browser language and redirect to appropriate language version of the website
# Redirect visitors who request the root domain path (e.g. www.mywebsite.ch) to the appropriate language version
# Fallback to English version if no matching browser language defined
# Based on language version being at e.g. www.mywebsite.ch/de/
# This has no effect on any subpaths of the website, and therefore has no effect on e.g. WordPress admin.
# Using a 302 temporary redirect header stops the redirection from being cached in the browser.
# language is ES-MX (Mexico)
RewriteCond %{HTTP:Accept-Language} ^es-mx [NC]
RewriteRule ^$ /mx/ [L,R=302]
@vitorbritto
vitorbritto / rm_mysql.md
Last active July 8, 2025 13:59
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql