Automatic versioning of Android build using git describe with Gradle

Put the following in your build.gradle file for the project. There’s no need to modify the manifest directly: Google provided the necessary hooks into their configuration. def getVersionCode = { -> try { def code = new ByteArrayOutputStream() exec { commandLine ‘git’, ‘tag’, ‘–list’ standardOutput = code } return code.toString().split(“\n”).size() } catch (ignored) { return … Read more

How to force browsers to reload cached CSS and JS files?

This solution is written in PHP, but it should be easily adapted to other languages. The original .htaccess regex can cause problems with files like json-1.3.js. The solution is to only rewrite if there are exactly 10 digits at the end. (Because 10 digits covers all timestamps from 9/9/2001 to 11/20/2286.) First, we use the … Read more

How to force the browser to reload cached CSS and JavaScript files

This solution is written in PHP, but it should be easily adapted to other languages. The original .htaccess regex can cause problems with files like json-1.3.js. The solution is to only rewrite if there are exactly 10 digits at the end. (Because 10 digits covers all timestamps from 9/9/2001 to 11/20/2286.) First, we use the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)