Skip to content

Instantly share code, notes, and snippets.

View rieckpil's full-sized avatar
Working remotely

Philip Riecks rieckpil

Working remotely
View GitHub Profile
rieckpil /
Created September 2, 2017 19:20
public class HelloWorld{
public static void main(String[] args) {
System.out.println("Hello from my first gist");
rieckpil /
Created September 2, 2017 19:23
Useful kafka commands
./ --topic topicName --broker-list localhost:9092
./ --create --replication-factor 1 --partitions 1 --zookeeper localhost:2181 --topic topicName
./ --describe --zookeeper localhost:2181
./ ../conf/
rieckpil /
Created December 9, 2017 10:10
Dependency Injection for 5 year olds
echo "
When you go and get things out of the refrigerator for yourself, you can cause problems. You might leave the door open,
you might get something Mommy or Daddy doesn't want you to have. You might even be looking for something we don't even have
or which has expired.
What you should be doing is stating a need, "I need something to drink with lunch", and then we will make sure you have
something when you sit down to eat.
rieckpil /
Last active August 19, 2018 18:52
Postgres Cheatsheet
# Postgres database as docker container
docker run -p 5432:5432 --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
# creating a table with auto increment primary key prior to PostgreSQL 10
CREATE TABLE category (
# creating auto increment primary key since PostgresSQL 10
rieckpil /
Created April 8, 2018 08:52
Transfer .html to .xhtml with java
public class ToXHTML {
* <dependency>
* <groupId>net.sf.jtidy</groupId>
* <artifactId>jtidy</artifactId>
* <version>r938</version>
* </dependency>
rieckpil /
Created October 3, 2019 18:02
WP API get all posts
public class WpClient {
public void getListOfBlogPosts(@Observes @Initialized(ApplicationScoped.class) Object object) {
Client client = ClientBuilder.newBuilder().build();
WebTarget webTarget ="");
JsonArray result = webTarget
.queryParam("per_page", 100)
rieckpil / application.yml
Created April 15, 2020 17:16
Debugging Hibernate - Settings for Spring application
show-sql: false
ddl-auto: none
hibernate.generate_statistics: true
rieckpil / sendowl.js
Created December 30, 2020 20:37
Trigger Cart Abandonment when Email is pre-filled on SendOwl's Checkout Page
Page.checkoutCallback = function () {
var email = document.getElementById("order_buyer_email").value;
if (email) {
rieckpil / rieckpil.css
Last active October 14, 2021 18:52
Custom Crayon Theme (Inspired by the IntelliJ IDEA Light Theme)
.crayon-theme-rieckpil {
border-width: 0px !important;
border-color: #999 !important;
border-style: solid !important;
text-shadow: none !important;
background: #fdfdfd !important;
.crayon-theme-rieckpil-inline {
border-width: 1px !important;
border-color: #ddd !important;
rieckpil /
Last active April 30, 2022 15:33
Intellij IDEA Live Template Examples

Live Template Examples for Testing Java Applications

Create new Live Templates within your IDEA's Preferences -> Editor -> Live Templates

mockMvcGET: Peform a MockMvc HTTP GET request.

org.springframework.test.web.servlet.MvcResult result = this.mockMvc
  .header(org.springframework.http.HttpHeaders.ACCEPT, org.springframework.http.MediaType.APPLICATION_JSON))