Skip to main content

Posts

Showing posts with the label open source

The first taste of Rust - A simple you tube downloader

Recently, I just learnt Rust and using it to write a simple youtube downloader with reference from node-ytdl . In this blog, I would like to share the code and how did I make it. You can find the full source code here . Install development environment I am using Windows 10 and scoop package manager. Therefore, I use the following commands. Run scoop install rustup-msvc to install rustup . Run setx "%path%;%USERPROFILE%\\scoop\\persist\\rustup\\.cargo\\bin" to add rustup to the path. Restart termial (git-bash in my case) and check the installation with rustup --version; rustc --version; cargo --version Export custom RUST_HOME : export RUSTUP_HOME=$HOME/scoop/persist/rustup/.cargo/bin/rustup Install a toolchain for rustup : rustup toolchain install stable-x86_64-pc-windows-msvc Setup project Run cargo new simple_rust_youtube_downloader --bin && cd simple_rust_youtube_downloader to create and navigate to the project. Add these dependencies to ...

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

Quick overview of Terraform 0.12

My first talk about terraform. A quick demo of terraform 0.12 beta 1. 😂 https://t.co/WTmxj2KwKD #terraform #cloudautomation #cloud — Anh Duong (@ninjahoahong) March 11, 2019 Presentation link: https://docs.google.com/presentation/d/1QjAKkVbITe1LlANJcoS4I8oP-j2yS0HCB8peCb8B0ao/edit?usp=sharing Reference: https://github.com/hashicorp/terraform-guides/tree/master/infrastructure-as-code/terraform-0.12-examples https://www.hashicorp.com/resources/introducing-terraform-0-12 https://www.terraform.io/upgrade-guides/0-12.html https://www.hashicorp.com/blog/terraform-0-1-2-preview

Unstoppable - an open source trivia game

I wrote a simple Android trivia game which is getting questions from https://opentdb.com/. You can check out the project at  gitlab . A sample game play can be seen in the below video. Feel free to give comments, git stars, or feedback. Download the game from play store:  https://play.google.com/store/apps/details?id=com.ninjahoahong.unstoppable Enjoy - 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.

Getting started with OpenCV4Android using Android Studio 2.0 preview

These are the steps to get started: Download open CV from this  link Extract the file and get OpenCV-android-sdk folder New --> Import Module --> choose OpenCV-android-sdk/sdk/java , and modify the folder of the module folder to what you like, such as:  opencv Open  opencv/build.gradle  change the version of  compileSdkVersion  and  buildToolsVersion  to suit with your project. Press  sync  gradle. Right click  app  module.  Choose Open module settings --> Choose Dependencies tab --> + --> module dependency --> opencv Copy  OpenCV-android-sdk/sdk/native/libs , paste to  app/src/main , and rename folder to  jniLibs Now, you can import and use OpenCV.

Simple threejs test

I have a strong passion for animation and game so from time to time, I am testing out libraries and tools to create the animation and game I like. And I came accross threejs which is a library with a lot of nice examples available in  their site . Therefore, I decided to make a simple animation out of it. This is my test  simple-sphere Threejs can produce pretty nice 3D animation with simple code base. However, this is just a starting point, there are a lot to learn and apply. If you have already working javascript for a while and want to make some cool 3D animation, why not try this library out. Have fun!

Try out Jekyll

Today, I decided to try jekyll to write my blog. It works out quite well. Faster and simpler than wordpress for writing a static site. And trying something new is very exciting as well. Let’s review what I have done: Open terminal:  Install rvm.  \curl -sSL https://get.rvm.io | bash -s stable --ruby Install jekyll gem:  gem install jekyll Create new repository name  ninjahoahong.github.io  on github jekyll new ninjahoahong Add origin remote with  git remote add origin ...  (… for you to fill your repo) Commit and push to master of the origin You can try the same to get a simple page. Updated in 2017: I am now using blogger to instead of Jekyll and move all the blogs here.