Skip to content

Instantly share code, notes, and snippets.

Matthias Kurz mkurz

  • Vienna, Austria
Block or report user

Report or block mkurz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mkurz
mkurz / debug-play-framework-test-intellij.md
Created Nov 16, 2018 — forked from jackmahoney/debug-play-framework-test-intellij.md
Debug Play Framework 2.x unit test in IntelliJ
View debug-play-framework-test-intellij.md

In build.sbt add the following lines:

Keys.fork in Test := false
parallelExecution in Test := false
  • Start the play console in debug mode $ play debug.
  • Create a RemoteDebug run configuration in IntelliJ. This is only a debugger, not a compiler.
  • Run this configuration listening on port 9999.
@mkurz
mkurz / ubuntu-https-mirrors.txt
Created Jul 10, 2018
Bash command to find out which ubuntu repo mirrors support https
View ubuntu-https-mirrors.txt
# From https://pastebin.com/QY2TQ1dq
# More details about the mirrors: https://launchpad.net/ubuntu/+archivemirrors
# Run this in bash
for mirror in $(wget -O - https://launchpad.net/ubuntu/+archivemirrors | grep '>http</a>' | cut -d '"' -f 2); do https_mirror=https${mirror#http}; wget --timeout 2 --tries=1 "$https_mirror" && echo "$https_mirror" >> https_mirrors; done
# Checkout the created file https_mirrors
https://mirror.aarnet.edu.au/pub/ubuntu/archive/
https://mirror.tcc.wa.edu.au/ubuntu/
https://mirror.reismil.ch/ubuntu/
@mkurz
mkurz / install.sh
Created Jun 5, 2018 — forked from rafi/install.sh
setup msmtp and php
View install.sh
apt-get install msmtp ca-certificates
vim /etc/msmtprc
# Set defaults.
defaults
# Enable or disable TLS/SSL encryption.
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
@mkurz
mkurz / error.log
Created Dec 14, 2017
Guice 4.1.0 exception when running with Java 9
View error.log
Exception in thread "main" com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalArgumentException
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2218)
at com.google.common.cache.LocalCache.get(LocalCache.java:4147)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140)
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5146)
at com.google.inject.internal.util.StackTraceElements.forMember(StackTraceElements.java:70)
at com.google.inject.internal.Errors.formatSource(Errors.java:817)
at com.google.inject.internal.Errors.formatSource(Errors.java:796)
at com.google.inject.internal.Errors.formatInjectionPoint(Errors.java:849)
View Example-Config.vpn
n:version:4
n:network-ike-port:500
n:network-mtu-size:1380
n:client-addr-auto:1
n:network-natt-port:4500
n:network-natt-rate:15
n:network-frag-size:540
n:network-dpd-enable:1
n:client-banner-enable:1
n:network-notify-enable:1
View EvolutionsModule.scala
package modules
import java.io.{FileInputStream, InputStream}
import javax.inject.{Inject, Provider, Singleton}
import play.api.db.DBApi
import play.api.{Configuration, Environment}
//import play.Environment
import play.api.db.evolutions._
import play.api.inject.{Injector, Module}
@mkurz
mkurz / html-languages.txt
Created Aug 11, 2016 — forked from JamieMason/html-languages.txt
HTML lang attribute / ISO language code reference / Culture names
View html-languages.txt
CULTURE SPEC.CULTURE ENGLISH NAME
--------------------------------------------------------------
Invariant Language (Invariant Country)
af af-ZA Afrikaans
af-ZA af-ZA Afrikaans (South Africa)
ar ar-SA Arabic
ar-AE ar-AE Arabic (U.A.E.)
ar-BH ar-BH Arabic (Bahrain)
ar-DZ ar-DZ Arabic (Algeria)
ar-EG ar-EG Arabic (Egypt)
@mkurz
mkurz / gist:061d413715f004c8c963
Created Jan 20, 2016 — forked from vr100/gist:81b37e89e9688d2ad02d
String and timestamp support in evolutions for play framework
View gist:061d413715f004c8c963
/**
* Read evolution files from the application environment.
*/
@Singleton
class EvolutionsReader @Inject() (environment: Environment) {
/**
* Read the application evolutions.
*
* @param db the database name
View success.html
<!doctype html>
<title>dynamic</title>
<button onclick="addGeneratedForms()">addGeneratedForms</button>
<script>
function addGeneratedForms(){
var div = document.createElement('div');
div.innerHTML = '<form class="login" method="post" action="login">\
<input type="text" name="username">\
<input type="password" name="password">\
<button type="submit">login</button> stay on this page but update the url with pushState\
@mkurz
mkurz / export_repo_issues_to_csv.py
Last active Oct 11, 2015 — forked from unbracketed/export_repo_issues_to_csv.py
Export Issues from Github repo to CSV (API v3)
View export_repo_issues_to_csv.py
#!/usr/bin/env python
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
"""
import csv
import requests
import json
You can’t perform that action at this time.