Icons by Font Awesome

My new articles are now published on my personal website. Find an updated version of this story at https://johann.pardanaud.com/blog/ship-an-android-app-with-a-pre-populated-database.

I recently had to create an Android app with a pre-populated database containing more than 8,000 rows. Unfortunately, Android doesn't provide any API to do this easily. After searching for a few minutes, I found a blog post explaining how to install a SQLite database from your assets to your app directory (by Juan-Manuel Fluxà) , which helped me to create my own database helper.

However, this article is a bit outdated (it was written in 2009), the code could benefit…


Icons by Font Awesome

My new articles are now published on my personal website. Find an updated version of this story at https://johann.pardanaud.com/blog/mapping-objects-in-javascript.

JavaScript has been evolving fast these last years, but object mapping is still a tricky part for beginners, especially if you don't want to mutate the original object.

Here are some code examples for ES5, ES2015 and ES2017+. They all use the map and reduce methods available on arrays. These two methods allow to separate the mapping logic from the object construction.

For each example, the goal is to transform this object:

{
a: 1,
b: 2,
}

To this one:


My new articles are now published on my personal website. Find an updated version of this story at https://johann.pardanaud.com/blog/about-circular-references-in-php.

Let me talk about some issues I encountered with circular references while working on my PuPHPeteer library.

How you can end with circular references

Under the hood, PuPHPeteer uses Rialto, a library I've created for the occasion. Rialto is a library to manage Node resources, therefore it needs to create a Node process and communicate with it. To do so, it has a ProcessSupervisor class which handles everything. In the early stage development, this class was handling way too much features.

To improve the separation of concerns, I've…


My new articles are now published on my personal website. Find an updated version of this story at https://johann.pardanaud.com/blog/create-a-default-error-page-with-laravel.

Defining a custom page for HTTP errors is pretty easy with Laravel:

Laravel makes it easy to display custom error pages for various HTTP status codes. For example, if you wish to customize the error page for 404 HTTP status codes, create a resources/views/errors/404.blade.php.

However, this requires to create a Blade file for each HTTP status you want to handle. An ideal solution would be to create a default view to display a generic error page for unhandled HTTP error codes.


My new articles are now published on my personal website. Find an updated version of this story at https://johann.pardanaud.com/blog/running-electron-on-heroku.

This article was written when only the Cedar-14 stack was available. I didn't try to run Electron on the new Heroku-16 stack, I will update the article the day I migrate my own app.

These last days I've developed a module to scrap some data with Nightmare, a headless browser based on Electron. …

Johann Pardanaud

Web developer working at batch.com - Passionate climber

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store