How to generate random sentence consisted of random words with PHP

In this post I’m going to share a simple PHP script to generate random sentence consisted of random pre-defined words.

For example I want to show a text saying: “Hi, thank you for visiting my website” several times, but I don’t want repetitively saying exactly that sentence. Then the solution is this program, which can randomize some of words in this sentence so somehow it uniquely showing different sentences with same meaning.

To see the example please watch this video:

Silly PHP Number Encoder and Decoder Program

Imagine you are creating a PHP program and you can pass some number parameter in url to retrieve content from your server. Then maybe you are thinking if you let people seeing those numbers in their url, they can change that number to any number to retrieve another content.

This program can prevent that. Instead of using raw number as your parameters, you can convert those numbers into something silly that people don’t understand, only your server knows, so they will not play around with your program.

Silly PHP Number Encoder is a simple program to convert any number into scrambled string characters and converting that back to original number.

Watch demo video here:

You can get this program on my GitHub link here: https://github.com/habibieamrullah/sillyphpnumencdec

Tutorial on Creating HTML5 and JavaScript Load More Button

In this video tutorial I’m sharing about how to create “Load More” button in JavaScript to show partial contents of an array variable.

Please note that in this technique first I retrieve all the information from server at single shot and store it in single array variable. So load more mechanism is happening on client side, not each time calling server to return partial contents.

Watch this video demonstration:

I am using jQuery for this code, so you need to include jQuery first. And here is the actual code:

Creating Greeting Card Maker WebApp with Phaser

Phaser.js is a good library for creating HTML5 games.

However, this time I tried to use Phaser to make a greeting card maker web app.

Visit CardU a webapp that I’ve made recently. You can test it and see how it works.

Here I will share the source code of index.html and main.js files used in this web app:

How to move an enemy towards the player in Unity3D

When you make a game, you often need to make enemies that move towards the player.

In this video I’ll share some method to move an enemy object towards the player in Unity3D.

Watch this video to see how to do it by creating a simple script:

And here is the script used on this video:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class enemymover : MonoBehaviour {

    public GameObject player;

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
        //transform.LookAt(player.transform);
        Quaternion targetRotation = Quaternion.LookRotation(player.transform.position - transform.position);
        transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, 1 * Time.deltaTime);
        transform.position += transform.forward * 1f * Time.deltaTime;
	}
}

How to disable “Authentication Required” or “Sign In” Pop Up in wp-admin

Sometimes when I tried to login to my WordPress websites I see a popup asking me to sign in. Well, I tried to enter my WP username and password but it doesn’t work.

After googling around, I found a solution to disable that thing.

One of the solutions is to add this codes to .htaccess of the website:

<filesmatch "wp-login.php">
Satisfy Any
</filesmatch>

If you have same problem, I hope you can try it too.

Google Play and Apple Play Store Icon SVG Codes for Web Pages

The common way to display an image on a web page is showing image files by using <img src=”blabla.jpg”> tag.

But the problem is image files are not good enough if you scale up the web page, you will see the pixels.

It’s time to use SVG instead image files.

This codes I’m going to share here is SVG codes of Google Play and Apple Play Store icons. You can copy and paste it in your pages.

Preventing multiple same ElectronJS apps to run at single time

I am building an EelectronJS app and successfully release it as an executable Windows program.

But the problem is when the app is already running, if I double-click again that .exe file, the second window of this app is running, but buggy. I don’t want it. So here is the solution:

How to change WordPress footer text with JavaScript

There is a common way to edit footer text of a WordPress site theme, it’s by modifying footer.php file. But if you got a new update of your theme, you will lose that, the footer reverted back to the original footer file.

But if you put this a few line of JavaScript codes in your widget, no matter how often you update the theme, you will have your own custom footer.

In this video I’ll show you how to do it: