Skip to content

Instantly share code, notes, and snippets.


Simon Legner simon04

  • Innsbruck, Austria
View GitHub Profile
simon04 / t.js
Created Aug 12, 2020
Minimalistic i18n for JavaScript
View t.js
var i18nMessages = {};
["en", "de", "it"].forEach(function (lang) {
url: "./i18n/" + lang + ".json",
dataType: 'json',
async: false,
success: function (data) {
i18nMessages[lang] = data;
View AMD Ryzen
          /:-------------:\          simon@simon-ssd
       :-------------------::        ---------------
     :-----------/shhOHbmp---:\      OS: Fedora 33 (Workstation Edition) x86_64
   /-----------omMMMNNNMMD  ---:     Kernel: 5.9.12-200.fc33.x86_64
  :-----------sMMMMNMNMP.    ---:    Uptime: 1 day, 3 hours, 40 mins
 :-----------:MMMdP-------    ---\   Packages: 1998 (rpm)
,------------:MMMd--------    ---:   Shell: fish 3.1.2
:------------:MMMd-------    .---:   Resolution: 3840x2160
:---- oNMMMMMMMMMNho .----: WM: i3
simon04 /
Created Jun 17, 2020
Serve swagger-ui using Jetty's DefaultServlet
simon04 /
Last active Oct 14, 2022
Lightweight REST API using Jersey on embedded Jetty server
package root;
import root.resources.HelloResource;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.servlet.ServletContainer;
public class Application {
simon04 / .gitignore
Last active Jul 22, 2022
Leaflet & webpack
View .gitignore
simon04 / en.yaml
Created Feb 4, 2020
node-polyglot for angularjs
View en.yaml
homepage: 'Navigate to the homepage'
user: 'Logged in as {{user}}'
load: 'Load {{smart_count}} item |||| Load {{smart_count}} items'
simon04 /
Created Jan 14, 2020
Git merge/replace orphan branch into master
git checkout --orphan new-framework
# completely rewrite your application in new framework
git merge --strategy=ours --allow-unrelated-histories master
git commit-tree -p HEAD^2 -p HEAD^1 -m "Merge branch 'new-framework'" "HEAD^{tree}"
git checkout master
git merge --ff-only new-framework
simon04 /
Last active Dec 17, 2019
Lists outdated win_chocolatey versions of Ansible tasks/roles
import xml.etree.ElementTree as ET
import glob
import urllib.request
import yaml
from ansible.playbook.helpers import load_list_of_tasks
def get_latest_version(id):
url = f'$filter=(Id%20eq%20%27{id}%27)%20and%20IsLatestVersion'
xml = ET.parse(urllib.request.urlopen(url))
simon04 /
Last active Dec 9, 2019 — forked from Gwerlas/
Migrate Jira issues to Gitlab
#!/usr/bin/env python2
import requests
from requests.auth import HTTPBasicAuth
import re
from StringIO import StringIO
import uuid
# Inspired from
# Tested on Jira 7.4 and Gitlab 2.2 with Python 2.7
JIRA_URL = 'https://your-jira-url.tld/'