change mamp php version

just doing this shit on your terminal and config file (in here im using zsh as shell)

$ vi .zshrc

and add this line

export PATH=/Applications/MAMP/bin/php/php7.1.1/bin:$PATH

then save and reload your zshrc

thank you source:


Change Guest Resolution Windows (Virtualbox)

First close virtualbox windows

then run this command in your terminal

$ VBoxManage setextradata global GUI/MaxGuestResolution any
$ VBoxManage setextradata "Win 10" "CustomVideoMode1" "1366x786x32"


Create Remove Iframe At Time

create iframe with src in table > td#marker

        function removeIframe(){
                var frame = document.getElementById("notif-to-user");

        function createIframe(){
                var ifrm = document.createElement('iframe');
                ifrm.setAttribute('id', 'notif-to-user');
                ifrm.setAttribute('src', '');
                var el = document.getElementById('marker');
                el.parentNode.insertBefore(ifrm, el);

            var date = new Date();
            // jika lebih dari jam 12 iframe di hapus
            if(date.getHours() > 1){
            // jika jam 1 lebih 1 menit iframe di buat
            if(date.getHours() === 1 && date.getMinutes() === 1){
            // jika jam 1 lebih 59 menit (jam 2) iframe di hapus
            if(date.getHours() === 1 && date.getMinutes() === 59){
            // jalan tiap 5 detik
        }, 5000);

Laravel 5.4 (Laravel Mix CSS/JS)

first we need to install npm & node.js

after that, go to your laravel fresh project (open terminal)

$ cd to/your/project
$ npm install

then open file and edit webpack.mix.js, on this example i want combine multiple js into one (minity also)

    'public/js/one.js', // create this file too
    'public/js/two.js', // create this file too
    ], 'public/js/combinejs.js'); // this file is appeared after below command

then run combine & minify with below command

$ npm run production


Create Function Google Shorterner

copy this function into your code

function get_googl($url){
    $apikey = 'yourApiKeyFromGoogle';
    $asset = array('longUrl' => $url);
    $object = json_encode($asset);
    $google = ''.$apikey;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $google);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type:application/json'));
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $object);
    $data = curl_exec($ch);
    $response = json_decode($data);
    $resulturl = $response->id;
    return $resulturl;

then using this function


echo get_googl('');