Skip to content

Instantly share code, notes, and snippets.

View simon04's full-sized avatar

Simon Legner simon04

  • Innsbruck, Austria
View GitHub Profile
@simon04
simon04 / index.js
Created September 23, 2015 08:06
Angular: modify locale NUMBER_FORMATS for numberFilter
// https://github.com/angular/angular.js/pull/9160#issuecomment-68950547
// http://plnkr.co/edit/qvzXkQkVtTLHvHVYXTdU?p=preview
angular.module('foo', []).config(config);
function config($provide) {
$provide.decorator('numberFilter', function($delegate) {
$delegate.$stateful = true;
return $delegate;
});
/*
HotCat V2.33
Ajax-based simple Category manager. Allows adding/removing/changing categories on a page view.
Supports multiple category changes, as well as redirect and disambiguation resolution. Also
plugs into the upload form. Search engines to use for the suggestion list are configurable, and
can be selected interactively.
Documentation: https://commons.wikimedia.org/wiki/Help:Gadget-HotCat
List of main authors: https://commons.wikimedia.org/wiki/Help:Gadget-HotCat/Version_history
@simon04
simon04 / 01-average-by-route.md
Last active April 12, 2016 18:12
Haltestellenabstände IVB aus OSM-Daten (https://www.openstreetmap.org/copyright, ODbL)
Average Route
286 m 1 Bergisel – Mühlauer Brücke
280 m 1 Mühlauer Brücke – Bergisel
326 m 3 Amras – Höttinger Au/West
326 m 3 Höttinger Au/West – Amras
1046 m 6 Bergisel – Igls
1046 m 6 Igls – Bergisel
403 m A Rum – Sadrach
461 m A Sadrach – Rum
@simon04
simon04 / app.js
Created May 18, 2016 10:21
Delay Angular $http requests for testing
angular.module('app').config(function($httpProvider) {
$httpProvider.interceptors.push(delayHttp);
function delayHttp($timeout) {
return {
response: function(response) {
return $timeout(angular.identity, Math.random() * 1000, true, response);
}
};
}
<?xml version="1.0" encoding="UTF-8"?>
<!-- Using optional BOM (0xEF 0xBB 0xBF) -->
<!-- From http://forum.openstreetmap.org/viewtopic.php?id=7186 -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://openstreetmap.org/osm/0.6"
xmlns="http://openstreetmap.org/osm/0.6">
<xs:element name="osm">
<xs:complexType>
<xs:sequence>
@simon04
simon04 / Interval.java
Last active February 2, 2024 15:36
Migrating from Joda Time to Java 8 JSR 310
import com.google.common.collect.Range;
import java.time.Duration;
import java.time.Instant;
import java.time.Period;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeParseException;
import java.time.temporal.TemporalAmount;
import java.util.Objects;
@simon04
simon04 / Caddyfile
Last active January 11, 2022 07:44
Nextcloud via Docker and Caddy
# /etc/caddy/Caddyfile
cloud.example.com {
root /srv/http/nextcloud/
fastcgi / localhost:7070 php {
root /var/www/html/
}
timeouts 30m
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#! /bin/bash
cd $(dirname $0)
verLocal=$(cat josm_version)
verRemote=$(wget -qO - http://josm.openstreetmap.de/latest)
echo local $verLocal remote $verRemote
if [ $verLocal -lt $verRemote ]; then
#!/bin/sh
set -e
# setup ssh-agent and provide the GitHub deploy key
eval "$(ssh-agent -s)"
openssl aes-256-cbc -K $encrypted_dc4c0df7bb33_key -iv $encrypted_dc4c0df7bb33_iv -in id_ed25519.enc -out id_ed25519 -d
chmod 600 id_ed25519
ssh-add id_ed25519
# commit the assets in build/ to the gh-pages branch and push to GitHub using SSH