Oct 3, 2015

It's time to make HTTPS default

It's time to make a move. 

When developing websites we are focusing on modern standards, like HTML5, CSS3, we put great attention to detail on design, UX and SEO.


It's time we do one more thing when building for the web.
It's time to enable SSL on the websites we make. No matter what the content is, even if it just a simple portfiolio. Keeping your clients privacy and maintaining security is YOUR responsibility. If you need a reason - even if it's just managing the content, you're probably forcing your clients to send their passwords in plain text when logging in the CMS.

It's time to make HTTPS the default.

Reasons for and "against" are covered in this article, but basically having SSL enabled websites lead to:
  • Better security
  • Better privacy for your users
  • Better referral data
  • Google ranks you better


Usually the thing that is holding us back are expenses. Buying a SSL certificate is not cheap, although it's only slightly more expensive than owning a domain name.
However, there are a lot of options, even free ones.
You can use Cloudflare, which can serve like a SSL proxy between your server and the client.
StartCom provides free SSL certificates, but their free license does not include commercial use. But there are good news.

In November, the Internet Security Research Group (ISRG) is launching Let's Encrypt, a free service for all.

Aug 20, 2015

Android stuck in bootloop

Upgrading and downgrading to/from Lollipop (Android 5) has caused some issues. Searching for a fix usually yields tutorials on how to do a factory reset i.e. wipe the whole device, which I do not want to do.

For me an easier fix worked.

It turns out that this whole ordeal is caused by Google Now launcher not starting. Some suggest trying someone calling you, which wouldn't work if you can't enter your PIN number.

Using ADB however, you can open up settings and do some things that could fix the problem.

adb shell am start -n com.android.settings/.Settings

In the settings you can go to 'applications' there swipe right to the 'disabled' category - where you can find 'Google Search' and you can enable it again.
One can probably install an alternative launcher - and if that works the disabling of the google launcher (aka 'Google Search') should not be a problem.

http://android.stackexchange.com/a/82049

This will fix the non-working home button and notifications not showing up. 
adb shell am start -n com.google.android.setupwizard/.SetupWizardTestActivity
Complete the wizard, stuff works again.
 http://forum.xda-developers.com/google-nexus-5/general/guide-dirty-flash-lpv-to-lrx21o-t2940358/post56756143#post56756143[1]

Jul 29, 2015

Opencart 2.x Main banner (slideshow) speed change

Open file /catalog/view/theme/default/template/module/slideshow.tpl and change the red value (in miliseconds):

$('#slideshow<?php echo $module; ?>').owlCarousel({
        items: 6,
        autoPlay: 5000,
        singleItem: true,
        navigation: true,
        navigationText: ['<i class="fa fa-chevron-left fa-5x"></i>', '<i class="fa fa-chevron-right fa-5x"></i>'],
        pagination: true
});

Jul 17, 2015

When to use MyISAM or InnoDB

When designing a database in MySQL one of the most common questions one can ask themselves is, is it better to use MyISAM or InnoDB engines for tables. There are other types of engines, but these are most common. There are also many articles on this topic, but I found that it boils down to a few simple things:

If you need FULLTEXT search, you need to use MyISAM.

If you need Foregin key support (for cascading and such), or you need to support transactions, you need to use InnoDB.




In general, if you do not need any of the special features, it's better to use MyISAM as it performs better (faster and more disk-friendly) for web applications.


There are other features that are not present in other engines as well.

 MyISAM Storage Engine Features
Storage limits256TBTransactionsNoLocking granularityTable
MVCCNoGeospatial data type supportYesGeospatial indexing supportYes
B-tree indexesYesT-tree indexesNoHash indexesNo
Full-text search indexesYesClustered indexesNoData cachesNo
Index cachesYesCompressed dataYes[a]Encrypted data[b]Yes
Cluster database supportNoReplication support[c]YesForeign key supportNo
Backup / point-in-time recovery[d]YesQuery cache supportYesUpdate statistics for data dictionaryYes
[a] Compressed MyISAM tables are supported only when using the compressed row format. Tables using the compressed row format with MyISAM are read only.
[b] Implemented in the server (via encryption functions), rather than in the storage engine.
[c] Implemented in the server, rather than in the storage engine.
[d] Implemented in the server, rather than in the storage engine.

Key Advantages of InnoDB

InnoDB is a high-reliability and high-performance storage engine for MySQL. Key advantages of InnoDB include:
  • Its design follows the ACID model, with transactions featuring commitrollback, and crash-recovery capabilities to protect user data.
  • Row-level locking (without escalation to coarser granularity locks) and Oracle-style consistent reads increase multi-user concurrency and performance.
  • InnoDB tables arrange your data on disk to optimize common queries based on primary keys. Each InnoDB table has a primary key index called the clustered index that organizes the data to minimize I/O for primary key lookups.
  • To maintain data integrity, InnoDB also supports FOREIGN KEY referential-integrity constraints.
  • You can freely mix InnoDB tables with tables from other MySQL storage engines, even within the same statement. For example, you can use a join operation to combine data from InnoDB and MEMORY tables in a single query.
  • InnoDB has been designed for CPU efficiency and maximum performance when processing large data volumes.

Jun 21, 2015

HTML+CSS Collapse table columns into rows in Media Query on small screens

The simple solution for this is:

@media(max-width:767px) {
table { 
display: block; 
}

th {
width:100%;
         display: block;
}
}

However, this trick (forcing display:block on column) only works for <th>, but not on <td>!