Categories
Personal

Pokemon Go

Last week, Niantic Incorporated launched the Pokemon Go in Singapore and everybody downloaded it. I have also tried it just to check out this addictive game.

It is quite fun playing it aside from it helps you to exercise without you knowing it. By means of walking or checking out some places. You’ll see people always check their phones and laughed to you or you to them when you saw them playing too.

Beside from being addictive game, it turns out that businesses took advantage to it. They’ve dropped some lures module (one of the item to attract Pokemons in the area) to attract people. Everyone will definitely stay and buy things from them.

It has been fun playing it and I hope it will give positive outcome to our society.

Categories
Server Web Development

CodeIgniter Cron In Different Environment

Here are few ways on how to run CodeIgniter cron through your command line interface (CLI).

Default way

This way is to just run the cron regardless of the environment. But by default it will use “development”.

* * * * * php path/to/your/codeigniter/index.php controller method "parameters"

With Environment

The setup below helps you once you are working on different environment. If you are using version before 3, you need to use ENVIRONMENT as your server variable.

# Version 2.2 and below
* * * * * export ENVIRONMENT="testing"; php path/to/your/codeigniter/index.php controller method "parameters"
# Version 3+
* * * * * export CI_ENV="testing"; php path/to/your/codeigniter/index.php controller method "parameters"

I hope those simple snippets above will help you. Drop some comments if you have some or any suggestions. Thanks.

Categories
AEM Java Programming Web Development

AEM Sightly’s nightmare

I’ve been working on Sightly templates which they are calling HTL (HTML Template Language). I’ve discovered some hacks/techniques on how to manipulate variables. So, I thought I’m already used to it.

I have worked on one component which I duplicated from my working component. I know it is going to work but actually something happened. I didn’t know why it is happening that frustrates me.

The data-sly-list is showing my the list keys instead of values. I kept changing my Java Use-API to think that something is wrong with my collection.

Actually nothing is wrong with my implementation. It was actually because of the double quotes (“”) that my editor is doing. Every time I write double quote it closes it with another one. If you are rushing, you will not be able to notice this in your HTML codes.

<!-- The double quote below will give you problem -->
<div class="class-name"">
    <p>Some text here</p>
</div>

<!--/* This code will always print your list keys */-->
<!--/* Instead of giving you the list and loop it as normal */-->
<sly data-sly-list="${javaUseAPI.listItems}">
    ${itemList.index}
</sly>

I’m using Visual Studio Code as my editor. They have added auto-completion for quotes on their latest updates. To disable it, you need to do the settings below.

{
     "editor.autoClosingBrackets": false
}

I know auto-completion in your code helps developer a lot. It just happened that it caused me some trouble and frustrate me a little bit. It is a good thing to remember that not all auto-completion are helpful. Sometimes it has some disadvantages and we need to take note of it.