Skip to content

Instantly share code, notes, and snippets.

View thomaseizinger's full-sized avatar

Thomas Eizinger thomaseizinger

View GitHub Profile
@thomaseizinger
thomaseizinger / IntelliJ Live Template for list encapsulation
Created March 19, 2015 13:25
A live template for IntelliJ IDEA to insert and encapsulate a list in Java. Paste the snippet into live template group under ~/.IntelliJIdeaXX/config/templates/
<template name="inslist" value="private java.util.List&lt;$T$&gt; $ts$ = new $listType$&lt;$T$&gt;();&#10;&#10;public java.util.List&lt;$T$&gt; get$Ts$() {&#10; return java.util.Collections.unmodifiableList($ts$);&#10;}&#10;&#10;private void set$Ts$(List&lt;$T$&gt; $ts$) {&#10; this.$ts$ = $ts$;&#10;}&#10;&#10;public void add$T$($T$ $t$) {&#10; this.$ts$.add($t$);&#10;}&#10;&#10;public void remove$T$($T$ $t$) {&#10; this.$ts$.remove($t$);&#10;}" description="Insert and encapsulate a list" toReformat="false" toShortenFQNames="true">
<variable name="T" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="listType" expression="subtypes()" defaultValue="" alwaysStopAt="true" />
<variable name="Ts" expression="capitalize(ts)" defaultValue="" alwaysStopAt="false" />
<variable name="t" expression="suggestVariableName()" defaultValue="" alwaysStopAt="false" />
<variable name="ts" expression="suggestVariableName()" defaultValue="" alwaysStopAt="false" />
<context>
<option name="JAVA
@thomaseizinger
thomaseizinger / alias-ruby-binaries.zsh
Last active March 26, 2019 09:49
Simple ZSH-Script that aliases all binaries found in the ruby bin directory so they can be called from a babun shell.
# Put this file under ~/.oh-my-zsh/custom if it should be automatically run for every babun shell that is opened.
# Credits to http://stackoverflow.com/questions/3831131/rubygems-cygwin-posix-path-not-found-by-ruby-exe#comment61900449_19424481
echo "Aliasing all ruby binaries."
if [[ -n "$(which ruby 2>/dev/null)" ]]; then
RUBY_BIN=$(cygpath -u $(ruby -e 'puts RbConfig::CONFIG["bindir"]'))
for f in $(find ${RUBY_BIN: : -1} -regex ".*bat$"| xargs -n1 basename); do
alias ${f%.bat}=${f}
done
@thomaseizinger
thomaseizinger / testSupport.gradle
Last active November 23, 2016 12:27
Gradle configuration for sharing code between several test source sets of a java project.
configurations {
// Create the configuration we will use to refer to our sources.
testSupport.extendsFrom compile
}
sourceSets {
// Creates two configurations (testSupportCompile, testSupportRuntime) we will ignore.
testSupport {
// We will at least need access to our main sourceSet and all dependencies that are declared for our configuration.
compileClasspath += sourceSets.main.output + configurations.testSupport

Keybase proof

I hereby claim:

  • I am thomaseizinger on github.
  • I am thomas_eizinger (https://keybase.io/thomas_eizinger) on keybase.
  • I have a public key ASB22yWraE2fryAt9ZbEaAdDGqURbmnTmwDN8-uffWJ7Hgo

To claim this, I am signing this object:

@thomaseizinger
thomaseizinger / Dockerfile
Created May 28, 2019 10:30
Install SU2 v6.2.0 in Ubuntu 18.04 with parallel support enabled
FROM ubuntu:18.04
RUN apt update
RUN apt install -y curl unzip mpi-default-dev m4 autotools-dev autoconf build-essential ssh
# Only if you don't have python already
RUN apt install -y python3 python-pip
RUN pip install python-config
# This is just like `cd /source`, you can choose any other folder ...
use anyhow::Context;
use bytecodec::{DecodeExt, EncodeExt as _};
use futures::{Future, FutureExt};
use std::{
collections::VecDeque,
net::{SocketAddr, ToSocketAddrs},
pin::Pin,
task::{ready, Poll, Waker},
time::{Duration, Instant},
};