setup docker for MySQL
Overview This is how I setup MySQL in docker for development so I can just copy and paste this. create volume create volume for saving data, by creating volume, it will make sure that tis volume is readable for our project. else it will use the parent directory name where the docker-compose.yml is located. If you use volume from inside MySQL container, the data will be lost when the container stops....
Use Golang Migrate on Docker Compose
Previously I setup docker compose for golang application and PostgreSQL. It can run the application and can connect to PostgreSQL. While doing basic CRUD, I found that I need a tool to migrate my database structure and seed the database for easy onboarding and development. Thus I want to use golang-migrate to do that. What Is Golang Migrate Contrary to the name, it is not a migration tool specifically created for golang development, although we can use it as a golang package in your application....
Golang: Keep JSON String as JSON. Or Dynamic JSON in Golang
The Problem I want to use response where the content field comes from external API response which will return varied formats. For example: { "souce": "http://guesthost.com/check-in", "payload": { "token" : "somerandomtoken", "id" : "1up" }, "content": { "name": "John Doe", "occupation": "Doctor" } } or { "souce": "http://localhost.com/hello-world", "payload": { "token" : "somerandomtoken", }, "content": { "status": 404, "message": "Missing resource or wrong naming" } } If you come here you should know that the usual way for Golang to create JSON is using struct then convert it to JSON string using json....
ImportError libffi.so.7 cannot open shared object file No such file or directory on Manjaro
This error happened after I try to run a Django project on Linux(Manjaro) after an sistem update. ImportError: libffi.so.7: cannot open shared object file: No such file or directory What Have I try: Install libffi using pacman pacman -Sy libffi The installation is successful but the error persists. Delete and recreate virtualenv it did not help neither. Solution Install That specific libffi.so.7 I use yay to search for suitable package to install...
Testing Set Up in Golang
File conventions, function naming conventions, how to separate test to test cases, send output (fmt.Println-ish), mark the test as fail ...
Dockerize Laravel Application Using Laradock
Create Docker containers for Laravel, MySQL, and PhpMyAdmin without fiddling with Dockerfile and docker-compose.yml. ...
Laravel 7.x Seeding
Laravel Version: 7.x(7.24) Seeding is one of my favorite tools that helps my development tremendously. This is how you could insert some(I mean whatever amount you want) records to database. Using Faker library to randomize the value, you could specify how far the randomness of your record values are. Check what Faker Provider could do and there’s additional Faker Provider Collection to step up your faking game. Just clone a project from the cloud?...
Dbeaver Jump Server Tunneling Problem On Linux
Overview I want to connect to remote MySQL server using DBeaver on linux. Note I need to connect jump server before I could open a connection to the database server. On Windows I could do that using Putty tunneling by SSH to first server, then from that server, I SSH second time to the DB server and tunnel the connection to a port. Using this recipe does not work on linux in my case....
docker-compose.yml for Golang Development
Hi, test things
Using For Loop In Alpine JS
The steps are: add alpine.js to head section of your HTML create loop data get data on template loop and show data Create Loop Data Make a function inside a script tag just above the </body> tag ... <body> ... <script> function theData() { return { produk: [ { name: "Boaty McBoatface", price: "$300.000", }, { name: "WD-40", price: "$45.000", }, { name: "Bugs for lyfe", price: "$105.000", }, ]}; } </script> </body> Get Data to HTML We need to make it available on the HTML....