Skip to content

Instantly share code, notes, and snippets.

Avatar

Eric Teubert eteubert

View GitHub Profile
@eteubert
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
<?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');
$node->appendChild($text);
$doc->saveXML($node);
@eteubert
eteubert / v3.0.0-changelog.md
Created Jul 22, 2020
Preliminary Release Notes for Podlove Publisher v3.0
View v3.0.0-changelog.md

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
eteubert / readme.md
Last active Jul 20, 2020
Simple template for Podlove Publisher Shownotes
@eteubert
eteubert / unstuck.md
Created Aug 30, 2019
ElixirLS + VSCode -- what to do if stuck
View unstuck.md
@eteubert
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/10.33.5.21.arm64
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/10.33.5.21.arm64
Mozilla/5.0 (Linux\; Android 9\; SM-J600FN) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36
AppleCoreMedia/1.0.0.19A536g (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
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
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 http://docs.podlove.org/podlove-publisher/reference/shortcodes.html#contributors for parameters #}
[podlove-episode-contributor-list]
{% endif %}
{% endif %}
@eteubert
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__)
end
def init(args) do
{:ok, args}
end
@eteubert
eteubert / adjustment.php
Last active May 17, 2018
Podlove Web Player 4 in Podlove Publisher: Hide Share Tab
View adjustment.php
<?php
add_filter('podlove_player4_config', function ($config) {
$config['visibleComponents'] = [
'tabInfo',
'tabChapters',
'tabDownload',
'tabAudio',
// 'tabShare',
'poster',
'showTitle',
You can’t perform that action at this time.