Skip to content

Instantly share code, notes, and snippets.

View mammuth's full-sized avatar

Max Muth mammuth

View GitHub Profile
@kepano
kepano / obsidian-web-clipper.js
Last active April 29, 2024 18:24
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
AWSTemplateFormatVersion: "2010-09-09"
Description: Subnet IP Monitor
Parameters:
Name:
Type: String
Default: "Subnet-IP-Monitor"
Tag:
Type: String
Description: Subnet Tag to filter
@mammuth
mammuth / apartment-distances.js
Last active July 17, 2019 18:33
Calculate your transit time between 1-n locations. Use if you want to compare travel time from a new flat to your favorite spots
/*
* What?
* A JavaScript script that prints out travel times between one origin and multiple targets.
*
* Example output
* $ node apartment-distances.js
* Marienplatz, Munich "24 mins"
* Google Munich "25 mins"
* Jetbrains GmbH, Munich "26 mins"
*
@unaiur
unaiur / HaasaLittle.py
Last active May 13, 2020 13:36
Simpler and faster version of Haaska AWS Lambda in https://github.com/mike-grant/haaska
#!/usr/bin/env python3.7
# coding: utf-8
# Copyright (c) 2019 Unai Uribarri <unaiur@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@DavidMStraub
DavidMStraub / mvg-card.js
Created July 13, 2018 14:06
MVG Live custom card for Home Assistant Lovelace UI
class MvgCard extends HTMLElement {
set hass(hass) {
const entityId = this.config.entity;
const state = hass.states[entityId];
const name = state.attributes['friendly_name']
if (!this.content) {
const card = document.createElement('ha-card');
card.header = name;
@OttoWinter
OttoWinter / 0migrator.md
Last active May 19, 2019 04:21
Lovelace Migration Script

Home Assistant Lovelace Migrator

Do you want to try out this experimental (!) new lovelace UI stuff in Home Assistant but don't want to migrate your entire configuration? This script is here to help! It reads in your Home Assistant configuration (specifically the group: section) and creates a matching ui-lovelace.yaml file in your Home Assistant configuration folder (of course backing up any previous file at that path).

To use this script, you first need to have python and home assistant installed where you plan to run this script. Do so using virtual environments and the pip3 install -U homeassistant command. Then copy below file to lovelace_migrate.py (any location should work) and run:

python3 lovelace_migrate.py -c <PATH_TO_HASS_CONFIG_DIR>
@mammuth
mammuth / email_obfuscation.py
Created November 21, 2017 10:21
Methods for obfuscating E-Mail addresses via HTML comments and JavaScript to prevent some spam in Django
"""
Requires django (mark_safe and escape)
Add the following two properties to your model (and update the naming of the email field)
In your templates: <a href="{{ person.email_obfuscated_href }}">{{ person.email_obfuscated_name }}</a>
Result: <a href="javascript:window.location.href = 'mailto:' + ['max', 'mustermann.com'].join('@')">max<!---->@<!---->mustermann.com</a>
Inspired by https://github.com/Blueshoe/djangocms-link2
"""
@matteo-grella
matteo-grella / GoogleMapsGeocodingHelper.kt
Created November 2, 2017 18:37
A Kotlin wrapper for the Google Maps Geocoding API v3
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
@solso
solso / human-web-overview.md
Last active December 6, 2019 12:36
Human Web Overview

Human Web Overview

Konark Modi, Alex Catarineu, Philipp Claßen and Josep M. Pujol at Cliqz *München, October 2016

[edited on October 2017]*

[edited on September 2019 to fix broken links and add reference to HPN paper]*

We recommend to read the article on Cliqz Tech blog, the content is more up to date there. Not removing this gist for historical reasons. December 2019.

@Aldarone
Aldarone / PKGBUILD
Created September 14, 2017 15:11
Building Signal Electron for Arch
# Maintainer: Jonas Heinrich <onny@project-insanity.org>
# Contributor: Jonas Heinrich <onny@project-insanity.org>
# Contributor: Alda <alda@leetchee.fr>
pkgname=signal
pkgver=1.0.24
pkgrel=1
license=('GPL3')
pkgdesc='Signal Private Messenger for the Desktop'
depends=('electron')