Skip to content

Instantly share code, notes, and snippets.

Avatar

Simon Legner simon04

  • Innsbruck, Austria
View GitHub Profile
@simon04
simon04 / t.js
Created Aug 12, 2020
Minimalistic i18n for JavaScript
View t.js
var i18nMessages = {};
["en", "de", "it"].forEach(function (lang) {
jQuery.ajax({
url: "./i18n/" + lang + ".json",
dataType: 'json',
async: false,
success: function (data) {
i18nMessages[lang] = data;
}
})
View AMD Ryzen 5.md
          /:-------------:\          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
simon04 / README.md
Created Jun 17, 2020
Serve swagger-ui using Jetty's DefaultServlet
View README.md
@simon04
simon04 / Application.java
Last active Oct 14, 2022
Lightweight REST API using Jersey on embedded Jetty server
View Application.java
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 {
View JOSM-IntelliJ.md
@simon04
simon04 / .gitignore
Last active Jul 22, 2022
Leaflet & webpack
View .gitignore
dist/
node_modules/
@simon04
simon04 / en.yaml
Created Feb 4, 2020
node-polyglot for angularjs
View en.yaml
---
navbar:
homepage: 'Navigate to the homepage'
user: 'Logged in as {{user}}'
load: 'Load {{smart_count}} item |||| Load {{smart_count}} items'
@simon04
simon04 / git.sh
Created Jan 14, 2020
Git merge/replace orphan branch into master
View git.sh
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 reset --hard $OUTPUT_FROM_PREVIOUS_COMMAND
git checkout master
git merge --ff-only new-framework
@simon04
simon04 / find-chocolatey-updates.py
Last active Dec 17, 2019
Lists outdated win_chocolatey versions of Ansible tasks/roles
View find-chocolatey-updates.py
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'https://chocolatey.org/api/v2/Packages()?$filter=(Id%20eq%20%27{id}%27)%20and%20IsLatestVersion'
xml = ET.parse(urllib.request.urlopen(url))
@simon04
simon04 / jira2gitlab.py
Last active Dec 9, 2019 — forked from Gwerlas/jira2gitlab.py
Migrate Jira issues to Gitlab
View jira2gitlab.py
#!/usr/bin/env python2
import requests
from requests.auth import HTTPBasicAuth
import re
from StringIO import StringIO
import uuid
# Inspired from https://gist.github.com/toudi/67d775066334dc024c24
# Tested on Jira 7.4 and Gitlab 2.2 with Python 2.7
JIRA_URL = 'https://your-jira-url.tld/'