Skip to content

Instantly share code, notes, and snippets.

View kubamarchwicki's full-sized avatar

Kuba Marchwicki kubamarchwicki

View GitHub Profile
@kubamarchwicki
kubamarchwicki / CacheableAbstractClassApp.java
Created January 6, 2019 22:03
Enable Spring Cache for abstract classes in Spring
package com.example.caching;
import lombok.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.CacheManager;
@kubamarchwicki
kubamarchwicki / SpringAutoRefreshConfigurationProperties.java
Last active September 6, 2021 10:20
Autorefreshable configuration in Spring. To reload run with `--application.config.location=file:/tmp/data.properties`
package com.example.properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;

Dziękuję za przestrzeń na opowiedzenie w kilku słowach o otwartych danych w ZTM. "Plan prezentacji i linki":

CivicHub 20/02/2018 - otwarte dane ZTM Gdańsk

twitter contact: @kubem

Co to są otwarte dane? Gdzie te dane są otwarte?

@kubamarchwicki
kubamarchwicki / MultiThreadExample.java
Created August 25, 2016 20:31
Java7 Fork Join Pool
package com.example.java7;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.*;
public class MultiThreadExample {
private static final Random PRNG = new Random();
@kubamarchwicki
kubamarchwicki / arq_containerless.adoc
Created October 27, 2015 12:47
Containerless Arquillian without deployment

I would like to use Arquillian Cube containerless to spin of already backed docker images (with an application deployed alread there).

The image is already prepared by a seperate project and what I would like to get is a separate project with integration test (wrtitten in Spock - ideally, but JUnit is ok so far).

This is pretty much as was described in here: on IRC transcription (the only place where I found the reference to something I’d like to get).

What I’m having is a container built elsewhere (a different project) and I’d like to use Arquillian Cube to use it and run tests against it.

@kubamarchwicki
kubamarchwicki / input.adoc
Last active August 29, 2015 14:04
Asciidoc metadata
//this is just for github to render a literal

== Personal details

[itemtype-Person]
--
[itemprop-name]#Jakub Marchwicki# +
[itemprop-url]#http://jakub.marchwicki.pl[Personal website]# +
[itemprop-email]#somename@gmail.com#
@kubamarchwicki
kubamarchwicki / exercise.txt
Last active August 29, 2015 14:01
Agile estimation. Ćwiczenie
Zadanie: Jaka jest suma wysokości oznaczonych budynków.
Motoryka:
1. Podzielcie się na kilka zespołów (5)
2. Zadanie1: Zastanówcie się i podajcie sumę wielkości budynków - wyrażoną w metrach
3. Humans are pretty bad at estimating (don't you hate it when people ask you to guess their age or weight?), and the more unknowns there are, the worse we are at doing it. By using relative estimation, we can then just shift things to a matter of scale. It is (generally) much easier to look at two things, and say roughly, one is twice the height of the other, or twice the size of the other.
4. Zadanie2: Budynek 5 ma wielkość "3". Podaj sumę wysokości wyrażoną w punktach.
5. Jeżeli nie czujecie story points, to możecie używać innych abstrakcyjnych wartości: Koszulki, złoty podział
6. Zadanie3: Podajemy rzeczywistą wielkość któregoś z budynków. Liczymy sumę wysokości.
@kubamarchwicki
kubamarchwicki / Tools.java
Last active August 29, 2015 14:01
Browsing randomly through the HR system...
public class Tools {
public static String dateToString(String date)
{
String t="0";
// mmrrr
if (date.length()==6) t=date.substring(2,6)+"0"+date.substring(0,1);
if (date.length()==7) t=date.substring(3,7)+date.substring(0,2);
if (date.length()==9) t=date.substring(5,9)+date.substring(2,4)+"0"+date.substring(0,1);
@kubamarchwicki
kubamarchwicki / MappingAPIExample.java
Last active January 1, 2016 22:49
Dozer deep index bug
package pl.marchwicki.dozer;
import org.dozer.DozerBeanMapper;
import org.dozer.loader.api.BeanMappingBuilder;
import org.dozer.loader.api.FieldsMappingOptions;
import org.dozer.loader.api.TypeMappingOptions;
import pl.marchwicki.basetypes.BeanA;
import pl.marchwicki.basetypes.BeanC;
import pl.marchwicki.basetypes.TargetBean;
@kubamarchwicki
kubamarchwicki / db-list
Created August 18, 2013 19:05
Firefox OS backup files
SMS - 226660312ssm.sqlite
Contacts - 3406066227csotncta.sqlite