Skip to content

Instantly share code, notes, and snippets.

Avatar

Tobias Preuss johnjohndoe

View GitHub Profile
@johnjohndoe
johnjohndoe / download-url-to-file.rb
Last active Aug 28, 2021
Ruby script to download a number of files from individual URLs via HTTP/HTTPS/FTP specified in an external file.
View download-url-to-file.rb
#!/usr/bin/env ruby
#
# Ruby script to download a number of files
# from individual URLs via HTTP/HTTPS/FTP
# specified in an external file.
#
# Author: Tobias Preuss
# Revision: 2013-04-18 16:26 +0100 UTC
# License: Creative Commons Attribution-ShareAlike 3.0 Unported
View device-art-generator.css
h4 {
text-transform: uppercase;
}
.device-list {
padding: 1em 0 0 0;
margin: 0;
}
.device-list li {
@johnjohndoe
johnjohndoe / EnumWithDefaultValueJsonAdapter.java
Created Dec 14, 2017 — forked from NightlyNexus/EnumWithDefaultValueJsonAdapter.java
An enum JsonAdapter for Moshi that allows for a fallback value when deserializing unknown strings. NOTE: Allows null for the default.
View EnumWithDefaultValueJsonAdapter.java
import com.squareup.moshi.Json;
import com.squareup.moshi.JsonAdapter;
import com.squareup.moshi.JsonReader;
import com.squareup.moshi.JsonWriter;
import java.io.IOException;
public final class EnumWithDefaultValueJsonAdapter<T extends Enum<T>> extends JsonAdapter<T> {
private final Class<T> enumType;
private final String[] nameStrings;
private final T[] constants;
@johnjohndoe
johnjohndoe / republica-2021-session.json
Created May 7, 2021
Sessions dump of re:publica 2021
View republica-2021-session.json
[
{
"nid": "39546",
"title": "„Team Timster“: Medienwissen für Kinder und Erwachsene",
"langcode": "und",
"changed": "1619190145",
"status": "Accepted",
"short_thesis": "Die Mediennutzung von Kindern wandelt sich: Einige Eltern sehen die Digitalisierung mit großer Sorge, andere bringen Medien kreativ in den Familienalltag ein. „Team Timster“ ist das Medienmagazin von KiKA, rbb und NDR. Im Gespräch blicken Soraya Jamal, Tim Gailus (Moderation „Team Timster“), Steffi Warnatzsch-Abra, Robin Blase und Inka Kiwit (Redaktion „Team Timster“) auf die Herausforderungen von medienpädagogischer Bildungsarbeit, aktuelle Themen und Fragen.",
"description": "<p>Die Mediennutzung von Kindern wandelt sich fundamental: Einige Eltern sehen die Digitalisierung im Kinderzimmer mit großer Sorge, andere bringen Medien kreativ und fördernd in den Familienalltag ein.</p>\r\n\r\n<p>„Team Timster“ ist das plattformübergreifende Medienmagazin von KiKA, rbb und NDR. Gemeinsam mit Grundschüler*innen entdecke
@johnjohndoe
johnjohndoe / vcard-split.py
Last active Apr 5, 2021 — forked from umrashrf/vcard-split.py
Python script to split Google contacts into individual VCF files.
View vcard-split.py
#!/usr/bin/python
#split vcf files
import re
working_dir = '/home/umair/Documents/Contacts/'
input_file = 'contacts starred 26-06-2014.vcf'
output_seed = 'contacts-part-'
vcards_per_file = 1
View streams-v2.json
[
{
"author": "CCC",
"conference": "33C3",
"description": "Live-Streaming vom 33C3",
"endsAt": "2016-12-30T20:00:00+0000",
"groups": [
{
"group": "Live",
"rooms": [
@johnjohndoe
johnjohndoe / ffmpeg-cut-video.md
Last active Jan 15, 2021
Cut a slice from a video with FFmpeg
View ffmpeg-cut-video.md

Cut a slice from a video

  • Keep all video and audio tracks
  • Add title, comment
ffmpeg -strict -2 -i input.mp4 -ss 00:33:22 -t 00:06:26 -metadata title="My Title" -metadata comment="A few words about this video." -c copy -map 0:v -map 0:a output.mp4
  • from ss position to -to position
@johnjohndoe
johnjohndoe / ffmpeg-scale-video.md
Created Jan 14, 2021
Resize / scale a video with FFmpeg
View ffmpeg-scale-video.md

Resize / scale a video with FFmpeg

  • Scale the input.mp4 to a height of 600px.
  • Let FFmpeg choose a number which is divisible by 2 to avoid the not divisible by 2 error.
ffmpeg -i input.mp4 -vf scale=-2:600,setsar=1:1 ouput.mp4

Related

@johnjohndoe
johnjohndoe / Rezept-Rosenkohl-in-Schmandsoße.md
Created Dec 20, 2020
Rezept: Rosenkohl in Schmandsoße
View Rezept-Rosenkohl-in-Schmandsoße.md

Rezept: Rosenkohl in Schmandsoße

Zutaten

  • Rosenkohl
  • 1 kleine Zwiebel
  • 100g Schinkenspeck
  • 1/2 halber oder ganzer Becher Schmand (je nachdem, wie viel Soße man möchte)
  • gefrorene Kräutern
  • Salz, Pfeffer
@johnjohndoe
johnjohndoe / pre-commit.sh
Created Nov 6, 2012
Git pre-commit hook to add a new line at the end of a file and remove trailing whitespaces
View pre-commit.sh
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# Usage:
# Remove the .sh file extension when you put the script in your hooks folder!
#