Skip to content

Instantly share code, notes, and snippets.

View stoerr's full-sized avatar

Dr. Hans-Peter Störr stoerr

View GitHub Profile
@iamkristian
iamkristian / log4jAdmin.jsp
Last active May 3, 2023 05:04
Change log4j log levels runtime from a jsp
<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ page import="org.apache.log4j.Level" %>
<%@ page import="org.apache.log4j.LogManager" %>
<%@ page import="org.apache.log4j.Logger" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Enumeration" %>
<%@ page import="java.util.Set" %>
<%@ page import="java.util.Arrays" %>
<%
/* This was originally suggested by Nelz on http://nelz.net/2008/04/08/log4j-runtime-configuration

RegEx

Online Regex Tester Suites & Code Generators

  • regex101 Online regex tester for PHP, PCRE, JavaScript and Python that highlights pattern and matches on the fly. Also features a code generator and a regex debugger!
  • myregextester Sports a separate regex split tester and allows to optimize patterns (I guess this is based on Perl's Regexp::Optimizer module).
  • regexr Online regex tester with good regex replace and explain functionality.
  • debuggex Shows neat expression diagrams (not active anymore).
  • regexper translates regular expressions into an SVG image (for documentation or embedding)
  • RexV2 Evaluator for PHP PCRE, PHP Posix!, Perl, Python, Javascript, Node.JS!
@stoerr
stoerr / getpackage.java
Last active March 11, 2021 08:38
Servlet to download a resource subtree from AEM as a content-package
/**
* This is a servlet that enables to download a package of a JCR subtree without
* having to create a package in the package manager. The package is
* created on the fly, and not saved to disk / the repository, so this is
* better suited to large content trees, but valuable also for quickly downloading
* a page.
*
* CAUTION: not suitable for production, only for internal testing systems!
*
* Usage with curl e.g.
@salomao-santos
salomao-santos / aem-component-dialog.md
Last active November 4, 2024 16:10
AEM Component: Dialog field example: structure of a dialog, checkbox, datepicker, fileupload, multifield, numberfield, pathbrowser, pathfield, radiogroup, richtext, select, textarea, textfield
@patrick-samy
patrick-samy / transcribe.py
Last active August 27, 2024 18:13
Split large audio file and transcribe it using the Whisper API from OpenAI
import os
import sys
import openai
import os.path
from dotenv import load_dotenv
from pydub import AudioSegment
load_dotenv()
openai.api_key = os.getenv('OPENAI_API_KEY')