/var/log

Update cache with ServiceWorker

There are many examples of updating the cache of a service worker, but they all assume you want to create a new cache. Most of the time, you only want to update just 1 or 2 files, like a stylesheet and some javascript file. A simpler approach for this is to just use the same […]

HTML5 history

For a web application I am developing (Courser) I need to control the history. The application can run in a browser but also as a "standalone" web app in Chrome and Safari. As a standalone app you have no navigation buttons, but I wanted to make the Android Back button work like expected and the […]

Titanium webview and local content

Working with local HTML, Javascript and CSS files in a webview can be very tricky in Titanium Appcelerator for a few reasons: The path to the HTML file is different on iOS and Android. Javascript files are optimized and encrypted during compiling stage. Only Javascript files that are referenced from within HTML files are left […]

Laravel dynamically detect environment

Laravel 5.2 comes with a .env file and tells you to not check it in. The idea behind it, is that you will have another .env file on your development, testing and production server. But if you want to dynamically detect and set your environment, this does not work too well. To make dynamically detection and […]

Laravel change paths

Change storage path To change the storage path in Laravel (tested with version 5.2 and 5.3) you have to extend the Application class and then override the storagePath() method. You can do this all in the bootstrap/app.php file: class MyApplication extends \Illuminate\Foundation\Application {   public function storagePath() {     return $this->basePath . '/../storage';   } […]

React, Babel and NPM

These are the steps to take when developing a React application with automatic JSX (and es2015 to es5) transformation with Babel. I don't use a bundel in this example, so you cannot use things like "import" and you have to add script tags to your HTML page to import Javascript files. Initialize your NPM project - […]

Add or delete multiple files in SVN

The following command will add all unknown files except for ignored ones: svn add --force . Or: svn add $( svn status | sed -e '/^?/!d' -e 's/^?//' ) To delete all files with ! in front: svn delete $( svn status | sed -e '/^!/!d' -e 's/^!//' )

Localization in app store iOS

Some remarks about localization an app in iTunes: The country associated with the Apple ID has to be one of the countries the app is published in to be able to find and install the app. So this has nothing to to with Settings / General / International / Region Format! You can change your […]

Clean PDF fixes crash on iOS

I recently tried to open a PDF but everytime I did, the Dropbox and Google Drive apps on iOS crashed. I fixed this by "cleaning" the PDF with MuPDF - I don't know what it does, except that after this action, the crashes where gone. If you download the MuPDF package, you can also find […]