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 / git.sh
Created January 14, 2020 07:16
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 reset --hard $OUTPUT_FROM_PREVIOUS_COMMAND
git checkout master
git merge --ff-only new-framework
@simon04
simon04 / en.yaml
Created February 4, 2020 14:15
node-polyglot for angularjs
---
navbar:
homepage: 'Navigate to the homepage'
user: 'Logged in as {{user}}'
load: 'Load {{smart_count}} item |||| Load {{smart_count}} items'
@simon04
simon04 / .gitignore
Last active September 19, 2023 12:33
Leaflet & webpack
dist/
node_modules/
@simon04
simon04 / Application.java
Last active September 29, 2023 08:06
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
simon04 / README.md
Created June 17, 2020 10:37
Serve swagger-ui using Jetty's DefaultServlet
> neofetch
             .',;::::;,'.                simon@simon-ssd
         .';:cccccccccccc:;,.            ---------------
      .;cccccccccccccccccccccc;.         OS: Fedora Linux 39 (Workstation Edition) x86_64
    .:cccccccccccccccccccccccccc:.       Kernel: 6.5.11-300.fc39.x86_64
  .;ccccccccccccc;.:dddl:.;ccccccc;.     Uptime: 10 days, 9 hours, 40 mins
 .:ccccccccccccc;OWMKOOXMWd;ccccccc:.    Packages: 2938 (rpm)
.:ccccccccccccc;KMMc;cc;xMMc:ccccccc:.   Shell: fish 3.6.1
,cccccccccccccc;MMM.;cc;;WW::cccccccc,   Terminal: /dev/pts/0
@simon04
simon04 / t.js
Created August 12, 2020 15:21
Minimalistic i18n for JavaScript
var i18nMessages = {};
["en", "de", "it"].forEach(function (lang) {
jQuery.ajax({
url: "./i18n/" + lang + ".json",
dataType: 'json',
async: false,
success: function (data) {
i18nMessages[lang] = data;
}
})
@simon04
simon04 / docker-compose.yml
Created August 20, 2020 09:14 — forked from puppybits/docker-compose.yml
sentry docker-compose
redis:
image: redis
postgres:
image: postgres
environment:
- POSTGRES_PASSWORD=sentry
- POSTGRES_USER=sentry
volumes:
- /var/lib/postgresql/data
@simon04
simon04 / README.md
Created August 21, 2020 09:11
Java URI copy constructor

Using the URI copy constructor on an URI where the userinfo part contains a percent-escaped colon (U+003A as %3A) produces a different result.