Skip to content

Instantly share code, notes, and snippets.

View s4ke's full-sized avatar
👨‍💻

Martin Braun s4ke

👨‍💻
View GitHub Profile
# Install ansible via git
pip3 install ansible==2.7.10
# Install ansible roles required for our playbook(s)
ansible-galaxy install geerlingguy.docker,v2.5.1 geerlingguy.mysql,v2.9.4
<profile>
<id>db-diff</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<dependencies>
</dependencies>
interface Functor<A> {
<B> Functor<B> map(Function<A,B> f);
}
class MyList<A> implements Functor<A> {
<B> MyList<B> map(Function<A,B> f) {
//map contents and return a new MyList
@s4ke
s4ke / convert_ps_to_pdf.bat
Created March 24, 2016 11:23
Convert PS to PDF (fixing bounding boxes) (Windows, Cygwin)
REM ALL HAIL CYGWIN
cp.exe "%1" "%1_org.ps"
ps2eps -f "%1_org.ps"
epstool --copy --bbox --output "%1_pre_pdf.eps" "%1_org.eps"
epstopdf "%1_pre_pdf.eps" --gsopt=-dEPSCrop --exact --outfile="%2"
rm "%1_org.ps"
rm "%1_org.eps"
sleep 1
rm "%1_pre_pdf.eps"
public static void sleep(long millis, BooleanSupplier condition, long delayMillis, Supplier<String> message)
throws InterruptedException {
long waited = 0;
long start = System.currentTimeMillis();
while ( !condition.getAsBoolean() ) {
Thread.sleep( delayMillis );
waited += System.currentTimeMillis() - start;
if ( waited >= millis ) {
throw new RuntimeException( "timeout: " + message.get() );
}
@s4ke
s4ke / TicTacToe.hs
Last active November 24, 2015 19:25
-- Martin Braun, 1249080
-- 5. Uebung
-- Tic Tac Toe
module Main where
import Data.Either
import Data.Char
import Data.List
import Data.List.Split
import Control.Monad.State
package org.hibernate.search.genericjpa.test.entities;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "Book")
@SecondaryTable(...)