Category: Programming

Programming stuffs.

  • Codeigniter 3 and PHP 8.0 / 8.1 Compatibility

    Codeigniter 3.1.12 (and above) now supports PHP 8.0 / 8.1.

    Latest Codeigniter 3 version now is 3.1.13.

    If you use Codeigniter older than 3.1.12, and you use PHP 8.0 / 8.1, then i suggest you to upgrade to the latest Codeigniter 3.

  • Use Mailgun Plain PHP Curl Code

    Mailgun is one of some services to send e-mail. It has a nice PHP library here. But for some reason, it only works in my local server, and it does not work at all in remote server and the code returns “Mailgun server is not reachable” error (although i have tried to disable server firewall, which was not a best decision).

    (more…)

  • Bitmex PHP API Example

    If you are looking for bitmex API example using PHP, you can use this code 🙂
    https://github.com/xrvel/xrvel-bitmex-api-php

  • Fix WordPress Cloudflare HTTPS Redirect Loop

    If you use Cloudflare flexible SSL certificate to use HTTPS, in some case you may get redirect loop.

    I believe it is caused because WordPress does not recognize the “fake” SSL certificate.

    Fixing it is simple.

    Open your wp-config.php file, and find this first line

    <?php

    (more…)

  • How to Install PhantomJS in cPanel / WHM Server

    Here is what i did to install PhantomJS in cPanel / WHM 🙂
    (more…)

  • Integrate reCAPTCHA v2 Into Pligg

    Pligg supports some CAPTCHA, including Solve Media, and old reCAPTCHA.
    Now i will write how to use reCAPTCHA v2 (click captcha) into Pligg.

    First, you must get Google reCAPTCHA keys.
    Second, open your Pligg admin, set the site & secret key under “CAPTCHA” sub menu and click “configure” next to reCAPTCHA.
    (more…)

  • Javascript Get Content Stretch Size

    I had a situation like this :

    I have a content. The size (width and height) has been known.
    Now i want to stretch the content to the screen with some fill rate (for example max 90% of screen size).

    I made a javascript code below.

    
    
  • How to Fix WARNING: Creating default object from empty value

    You may encounter this “warning” message when using PHP 5.4 or above

    E_WARNING: Creating default object from empty value

    Here is how to fix this 🙂
    (more…)

  • CSS Media Query

    Here is a simple example of CSS media query 🙂

    http://pastebin.com/dkdfAvGF