Skip to content

Instantly share code, notes, and snippets.


Eric Teubert eteubert

View GitHub Profile
eteubert / xml_generate_tag.php
Created Aug 11, 2020
Generate a single XML element (for example for an RSS feed). Much better than doing it by hand as it ensures the text content is valid / escaped.
View xml_generate_tag.php
$doc = new DOMDocument();
$node = $doc->createElement("itunes:summary");
// either one is fine, both generate valid XML
// $text = $doc->createTextNode('I am <foo> example & so');
$text = $doc->createCDATASection('I am <foo> example & so');
eteubert /
Created Jul 22, 2020
Preliminary Release Notes for Podlove Publisher v3.0

Podlove Publisher v3.0 Release Notes

Breaking Changes

  • requires PHP 7.0 (or newer)
  • requires WordPress 5.2 (or newer)
  • Web Player:
    • removes Podlove Web Player 2
    • removes Podlove Web Player 3
    • removes "insert player automatically" option (probably does not affect anyone as the web player is by default inserted via template)
eteubert /
Last active Jul 20, 2020
Simple template for Podlove Publisher Shownotes
eteubert /
Created Aug 30, 2019
ElixirLS + VSCode -- what to do if stuck
eteubert / user_agents.csv
Created Aug 25, 2019
10.000 Random User Agents
View user_agents.csv
We can't make this file beautiful and searchable because it's too large.
Mozilla/5.0 (Linux\; Android 9\; Mi A1 Build/PKQ1.180917.001\; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.111 Mobile Safari/537.36 GSA/
yourApplicationName/2.17.43 (Linux\;Android 5.1.1) ExoPlayerLib/2.10.0
atc/1.0 watchOS/6.0 model/Watch4,4 hwp/t8006 build/17R558 (6\; dt:193)
Mozilla/5.0 (Linux\; Android 9\; Mi MIX 2S) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36
Mozilla/5.0 (Linux\; Android 9\; SAMSUNG SM-G960F Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36
Mozilla/5.0 (Linux\; Android 9\; SM-G950F Build/PPR1.180610.011\; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.111 Mobile Safari/537.36 GSA/
Mozilla/5.0 (Linux\; Android 9\; SM-J600FN) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36
AppleCoreMedia/ (Macintosh\; U\; Intel Mac OS X 10_15\; de_de)
View ex_bench.ex
start = System.monotonic_time(:millisecond)
foo = testme()
time_spent = System.monotonic_time(:millisecond) - start
IO.puts("Executed testme() in #{time_spent} #{:millisecond}")
eteubert / tasks.json
Last active Feb 13, 2019
VS Code: Task to run Elixir tests
View tasks.json
"version": "2.0.0",
"tasks": [{
"group": {
"kind": "test",
"isDefault": true
"label": "elixir: run stale tests",
"type": "shell",
"command": "mix test --stale",
eteubert / default.twig
Created Oct 22, 2018
Podlove Publisher Default Template
View default.twig
{% if not is_feed() %}
{# display web player for episode #}
{{ episode.player }}
{# display contributors if module is active #}
{% if shortcode_exists("podlove-episode-contributor-list") %}
{# see for parameters #}
{% endif %}
{% endif %}
eteubert / progress.ex
Created Jul 20, 2018
Elixir GenServer to render a progress bar
View progress.ex
defmodule Some.Progress do
use GenServer
def start_link() do
GenServer.start_link(__MODULE__, %{total: 0, progress: 0}, name: __MODULE__)
def init(args) do
{:ok, args}
eteubert / adjustment.php
Last active May 17, 2018
Podlove Web Player 4 in Podlove Publisher: Hide Share Tab
View adjustment.php
add_filter('podlove_player4_config', function ($config) {
$config['visibleComponents'] = [
// 'tabShare',
You can’t perform that action at this time.