Fixing GMail Disable Less Secure App on May 2022

We used to toggle https://myaccount.google.com/lesssecureapps to use PHPMailer. Unfortunately on May 2022, Google disable this option. There is a workaround if you want to use free SMTP from GMail on your website.

Step 1. Login to you Google Account

Step 2. Select Security

Step 3. On Signing in to Google section, Click App passwords https://myaccount.google.com/u/2/apppasswords

Read more of this post

Row Number on MySQL PDO

There are few approaches to generate sequence row number.

On regular MySQL or MySQLi query it would be utilize SET statement

set @row_number = 0;
select 
	(@row_number:=@row_number + 1) AS num,
	column_name
from table_name

But PDO can’t execute multiple queries separated by semicolon.

If you running MySQL version 8, it have built in function row_number() and this is how it looks like

Read more of this post

Add Detail Text on App Inventor ListView

Since version nb187 (mid 2021), App Inventor adding support for custom list view. This is anticipated feature that make App Inventor capable to display multiple custom list view:

  • Basic list
  • Main text and Detail text (both vertical and horizontal)
  • Picture, Main text and Detail text

I’ve been waiting this for so many years, and it finally here. We used to put HTML line break on Kodular to display simple main and detail list view. App Inventor Custom List View is now a native component.

But how it works? How we put item dynamically? How we add item programmatically as Main text and Detail Text on List View.

Read more of this post

Synaptic/ThinkPad touchpad click less sensitive

You may have new laptop with Synaptic driver and tapping one finger on the touch pad is less sensitive.

  • Make sure Synaptic folder is writable to store the settings.
  • Uncheck readonly to folder C:\Program Files\Synaptics\SynTP
  • Open LenovoShortcut‘s link inside the folder mentioned above.
  • Click Thinkpad menu on the right top corner
  • Click Settings..
  • Click Advanced on the right top corner
  • On Smart Check like shown at the above picture. Set Palm Check Threshold to Min

Disable IOS Scrolling. Overflow hidden is not working

iPhone and iPad are refusing simple CSS/JS rule, overflow : hidden to disable scrolling There are some tips from the Internet, such as:

  • Put wrapper, then use html, body, #wrapper {overflow:hidden, height:100% },
  • Put some webkit prefix css,
  • Change page to position absolute,
  • Add special JS library.

Those ideas are frustrating and not working as expected. Until someone at stackoverflow wrote this code below that actually works

Read more of this post

How to connect WiFi on Windows CE

You already turn on your wifi adapter on Control Panel, but the wifi icon on the taskbar still appear crossed.

The problem is no saved SSID is available to connect. Windows CE have ridiculous WiFi hidden settings. This is probably because not enough setting page to fit into control panel.

Read more of this post

Showing and Hiding menu with pure CSS

We used to code showing and hiding menu/navigation with Javascript.

<div>
    <a href="#hide" id="hide">≡ Navigation</a>
    <a href="#show" id="show">x Navigation</a>
    <ul id="list">
        <li>Products</li>
        <li>About Us</li>
        <li>Contact Us</li>
    </ul>
</div>

Read more of this post

Adding Addslashes Inside $_POST / $_GET

Imagine you working on modular php codes, and you want to sanitize your $_POST or $_GET inputs for database query.

Most of the time you add individual addslashes to variables, and you missed to add addslashes in here and there.

Turns out we can injecting addslashes to each predefined array values by using array_walk, the shortest one by using lambda function (require PHP 5.3)
Read more of this post

Hamburger Menu by Simple Javascript and CSS Transition

Facebook app for iPad is famous for it left slide navigation. We can unveil left side menu by tapping three horizontal lines on the top left corner. Some people called it hamburger menu, or three stripes menu.

facebook left menu

With animation, the left menu pushing the content to the right.

How we can reproduce this by using simple javascript and simple css, without jQuery, without JavaScript framework and also cross browser, working on smartphone browser too?

menu

Actually it just basic CSS to manipulate ‘position’ and ‘left’ properties.
First you can copy this code below:

Read more of this post

Increase/Decrease Percentage Between Two Numbers

For example, we have:

Previous Point = 98782
Current Point = 136544

It mean we have increase 38.2% from previous point to current point.

This is how to calculate in PHP
Read more of this post