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
rieckpil / WpClient.java
Created October 3, 2019 18:02
WP API get all posts
@ApplicationScoped
public class WpClient {
public void getListOfBlogPosts(@Observes @Initialized(ApplicationScoped.class) Object object) {
Client client = ClientBuilder.newBuilder().build();
WebTarget webTarget = client.target("https://rieckpil.de/wp-json/wp/v2/posts");
JsonArray result = webTarget
.queryParam("per_page", 100)
@rieckpil
rieckpil / commands.sh
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 (
ID SERIAL PRIMARY KEY,
DESCRIPTION VARCHAR(255)
);
# creating auto increment primary key since PostgresSQL 10
@rieckpil
rieckpil / ToXHTML.java
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
rieckpil / di.sh
Created December 9, 2017 10:10
Dependency Injection for 5 year olds
#/bin/bash
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
rieckpil / kafka.sh
Created September 2, 2017 19:23
Useful kafka commands
./kafka-console-producer.sh --topic topicName --broker-list localhost:9092
./kafka-topics.sh --create --replication-factor 1 --partitions 1 --zookeeper localhost:2181 --topic topicName
./kafka-topics.sh --describe --zookeeper localhost:2181
./zookeeper-server-start.sh ../conf/zookeeper.properties
@rieckpil
rieckpil / HelloWorld.java
Created September 2, 2017 19:20
MyFirstGist
public class HelloWorld{
public static void main(String[] args) {
System.out.println("Hello from my first gist");
}
}