Skip to content

Instantly share code, notes, and snippets.

Avatar

Tobias Preuss johnjohndoe

View GitHub Profile
@johnjohndoe
johnjohndoe / fileshuffle.py
Last active Jul 13, 2022
Shuffle two file names and copy the active file to a destination folder.
View fileshuffle.py
#!/bin/python3
import os
import sys
from shutil import copyfile
def getScriptPath():
"""
Returns the full directory path of this script.
"""
@johnjohndoe
johnjohndoe / Google-tax-number-and-address.md
Created Apr 22, 2014
Google / German tax number and address
View Google-tax-number-and-address.md

Google

Tax number for Germany

DE283139298

Address

Google Ireland Ltd
> Gordon House, Barrow Street

@johnjohndoe
johnjohndoe / EnumWithDefaultValueJsonAdapter.java
Last active Mar 24, 2022 — 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. https://github.com/square/moshi/blob/master/moshi-adapters/src/main/java/com/squareup/moshi/adapters/EnumJsonAdapter.kt
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 / vimeo.com.ffpreset
Created Dec 15, 2011
FFmpeg settings for vimeo.com
View vimeo.com.ffpreset
// FFmpeg settings for vimeo.com
// =============================
// Trying to find the best settings for encoding videos as described here: http://vimeo.com/help/compression
//
// Input file: MTS
// Video: H264, 1920x1080, 50fps
// Audio: A52 Audio (aka AC3), Stereo, 48kHz, 256kbps
ffmpeg -i input.mts -vcodec libx264 -acodec aac -strict experimental -vpre hq -s hd720 -b 5000k -ab 320k -r 25 -g 25 -threads 0 output.mp4
View gedenktafeln-berlin.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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!
#
@johnjohndoe
johnjohndoe / vcard-split.py
Last active Oct 21, 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
@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 / 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