Skip to main content

Posts

Showing posts with the label java

Scripting with Java

I think Java is quite verbose for scripting. However, it can also be fun. I wrote a very simple experiment of ls command. You should try it out. Download file ls and chmod +x ls then you can run ./ls . There are no flags/options supported.😆 - ninjahoahong

A starting project example for Spring Boot 2 with Postgresql, Swagger2, and JWT

Inspired by my colleague, I have spent some time putting together a Spring Boot 2 starting project. Audience: Developers who would like to have a structured Spring Boot 2 project to compare. Link to the repository: spring-boot-example Dependencies: Spring Actuator for management lombok for easy annotations swagger and swagger-ui for docs Spring devtools for dev Spring security for signup and login postgresql for database jpa for database access jjwt for jwt in java h2 for database using in test security test for testing security stuffs Spring Boot Starter Test for testing boot application What in the examples: Simple sign up and login. Simple Rest API demostration. Auto database migration with Flyway. Auto documentation generation with Swagger2 Build with gradle. Running locally with Docker + docker-compose. Store data in Postgresql database. Init database with startup sql-script. Some unit test for the Rest API. Reference: My colleague proje...

An Oauth2 Authorization Server Sample with Spring Boot, Spring Security, Gradle, Postgresql, and Flyway

I recently decided to make a sample code for An OAuth2 Authorization Server with Spring Framework , Gradle , Posgresql , and Flyway . The reason is because the lack of sample for Spring with Gradle build tool. Audience: * The sample code is for readers who have some knowledge of Java, Postgresql, Spring, and Gradle and look for the way to put it together. What in the examples: * Provide JWT * Auto database migration with Flyway * Build with gradle * Running locally with Docker + docker-compose * Store data in Postgresql database * Init database with startup sql-script Link to the repository: spring-oauth2-authorization-server - ninjahoahong

Using RoboPOJOGenerator

Recently, I have used more AutoValue in my Android projects and needed to copy and paste quite many set up codes. Then I decided to try RoboPOJOGenerator out, it is working great with AutoValue and this AutoValue Gson library . Reference: https://github.com/robohorse/RoboPOJOGenerator https://github.com/rharter/auto-value-gson - ninjahoahong

Setup libGDX Android Game Project

These are the steps: Download the project setup tool from  here Open the jar file   Tick Android box, choose an empty folder as destination, and choose AndroidSDK path. You can also tick any extensions you want. Open Android Studio. Choose  Import Project  –> Choose  build.gradle  file in the project root. Start writing your game.  Good luck and have fun.