Skip to content

Instantly share code, notes, and snippets.

View mammuth's full-sized avatar

Max Muth mammuth

View GitHub Profile
@mammuth
mammuth / GefluegelteWorteFetcher.py
Last active August 29, 2015 14:11
Crawls the Wikipedia "Liste geflügelter Wörter" and saves the word itself and it absolute link in a dictionary
"""
This Python3 Script extracts all the quotes (and their links) from the Wikipedia 'Liste geflügelter Worte', which is a list of familiar quotations.
Furthermore it stores them into a database.
FYI: Currently it's 2125 quotations long.
"""
from urllib import request
import re
import string
import sqlite3 as lite
@mammuth
mammuth / bg_card.xml
Created April 9, 2015 13:00
[Android] GoogleNow like Card as a XML Background Drawable
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle"
android:dither="true">
<corners android:radius="3dp"/>
<solid android:color="#ccc" />
</shape>
</item>
@mammuth
mammuth / backup_app_data.sh
Last active August 29, 2015 14:25
Backup the complete data of any android app to your computer. Using ADB. Requires root for ADB.
#!/bin/bash
# This little shell script copies a backup of a certain app into the folder
# backup/ within the execution directory
# requires root via adb access
appToBackup="org.thoughtcrime.securesms" #change package name
tmpStore="tmpBackup_"$appToBackup"/"
adb devices
@mammuth
mammuth / MaterialColor.java
Created August 2, 2015 13:28
Enum for the easy reference of the most important material colors.
public enum MaterialColor {
RED (R.color.red_400, R.color.red_900, R.color.red_700, "red"),
PINK (R.color.pink_400, R.color.pink_900, R.color.pink_700, "pink"),
PURPLE (R.color.purple_400, R.color.purple_900, R.color.purple_700, "purple"),
DEEP_PURPLE(R.color.deep_purple_400, R.color.deep_purple_900, R.color.deep_purple_700, "deep_purple"),
INDIGO (R.color.indigo_400, R.color.indigo_900, R.color.indigo_700, "indigo"),
BLUE (R.color.blue_500, R.color.blue_900, R.color.blue_700, "blue"),
LIGHT_BLUE (R.color.light_blue_500, R.color.light_blue_900, R.color.light_blue_700, "light_blue"),
CYAN (R.color.cyan_500, R.color.cyan_900, R.color.cyan_700, "cyan"),
@mammuth
mammuth / GermanCities.json
Created September 10, 2015 09:34
This json file maps all German city names WITHOUT their umlaut to the corresponding name WITH the umlaut. Eg: "Garching-Hochbrueck":"Garching-Hochbrück"
{"Seehausen (Altmark)":"Seehausen (Altmark)",
"Tamm":"Tamm",
"Breitengueßbach":"Breitengüßbach",
"Riethnordhausen":"Riethnordhausen",
"Rinteln-Krankenhagen":"Rinteln-Krankenhagen",
"Buchfart":"Buchfart",
"Straupitz":"Straupitz",
"Rambach":"Rambach",
"Caputh":"Caputh",
"Malchow":"Malchow",
@mammuth
mammuth / import-calendar-feeds.php
Created April 17, 2015 20:45
Owncloud 8 Calendar Feed importieren
<?php
/*
* Dieses Script importiert die Events aus einem ics-Calendar-Feed in Owncloud 8 oder 7. Die Kalender werden jeweils nur dann aktualisiert, wenn das Skript aufgerufen wird - sprich hier sollte ein cronjob für die Ausführung des Scripts erstellt werden.
*
* (Es sind einige Anpassungen im Skript notwendig)
*
* Gefunden auf zeit-zu-handeln.net. Kleine Anpassungen für Owncloud 8.
*/
//Hier den Pfad zur Owncloud-Installation einfügen
@mammuth
mammuth / docker-teamspeak-snapshot.sh
Created October 7, 2016 12:43
This script backups a Docker container instance, by creating a new docker image and exports this to a .tar
#!/bin/sh
log_file=${BACKUP_LOG_FILE}
backup_script_name="docker-teamspeak-snapshot"
date=$(/bin/date +"%Y-%m-%d_%H-%M-%S")
echo "Started $backup_script_name at $date" >> $log_file
echo "Create a new snapshot_teamspeak docker image.." >> $log_file

Keybase proof

I hereby claim:

  • I am mammuth on github.
  • I am muth (https://keybase.io/muth) on keybase.
  • I have a public key whose fingerprint is A5A6 0414 169C 05C0 2D9D 60C5 2227 B61A 9E20 EA50

To claim this, I am signing this object:

@mammuth
mammuth / github_bot.py
Last active March 8, 2017 15:23
Simple script that allows us to comment to pull requests with a GitHub bot
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import json
import requests
GITHUB_API_URL = 'https://api.github.com'
TOKEN = 'YOUR_SECRET_TOKEN_HERE'
/* ---------------
name: Clean Google Calendar
author: @Gambloide
matches: https://google.com/calendar/*
version: 1.0
------------------ */
/* Calendar */