Skip to content

Instantly share code, notes, and snippets.

View mraerino's full-sized avatar

Marcus Weiner mraerino

View GitHub Profile
@mraerino
mraerino / designer.html
Last active August 29, 2015 14:26
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
@mraerino
mraerino / gist:dcc59bbca9f267bfb80d
Created November 23, 2015 19:08
site.conf location testing
{
hostname_prefix = 'ff-ddorf',
site_name = 'Freifunk Duesseldorf',
site_code = 'ddorf',
prefix4 = '10.25.0.0/19',
prefix6 = '2a03:2260:3004:25::/64',
timezone = 'CET-1CEST,M3.5.0,M10.5.0/3',
ntp_servers = {
'2.pool.ntp.org',
},
@mraerino
mraerino / header-generator.py
Created February 9, 2016 15:33
svg generator script i hacked for automation of email header generation
from xml.sax.saxutils import escape as xmlescape
import subprocess
import os
import re
import sys
def get_valid_filename(s):
"""
Returns the given string converted to a string that can be used for a clean
filename. Specifically, leading and trailing spaces are removed; other

Joomla richtig patchen

Repo vorbereiten

Im ersten Schritt sollte man in einem neuen Repo ein Branch original anlegen, das die Komponenten/Teile enthält, die man patchen möchte. Dann den master und den develop Branch aus original erstellen

Änderungen vornehmen und testen

Im develop Branch sollten die Änderungen vorgenommen werden. Wenn man die Änderungen getestet hat, kann man develop in master mergen.

@mraerino
mraerino / 0_reuse_code.js
Created May 17, 2016 10:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mraerino
mraerino / yotilo-extract.js
Last active May 10, 2017 19:17
Yotilo data extraction
const data = document.getElementsByTagName('days-list')[0].days
.map(day => ({ day: (new Date(day)).toLocaleDateString(), items: JSON.parse(localStorage.getItem('day-'+day)) }))
.filter(e => e.items.length > 0)
.reduce((sum,e) =>
sum.concat(e.items.map(i => Object.assign({}, i, { day: e.day }))),
[]);
@mraerino
mraerino / viprinet-router-init.py
Created October 12, 2017 12:30
Initial a bare Viprinet router without the need to execute a Windows binary
#!/usr/bin/env python3
import socket
import sys
import ipaddress
# setup sockets
sendsock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sendsock.bind(("169.254.54.81",6000))
sendsock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
@mraerino
mraerino / has-shadow-root.js
Last active January 18, 2018 13:23
Testing Fit-Html components using Web-Component-Tester
suite('ShadowRoot', function() {
test('ShadowRoot exists', function() {
const Component = FitHtml.connect(
() => console.log('state props called'),
{},
() => FitHtml.html``
);
customElements.define('test-has-shadow-root', Component);
litHtml.render(litHtml.html`
version: '3'
networks:
frontend:
services:
prometheus:
image: prom/prometheus
volumes:
- "prometheus:/prometheus"
defaultEntryPoints = ["https", "http"]
################################################################
# Web configuration backend
################################################################
[web]
address = ":8080"
################################################################
# Docker configuration backend