Truncate Data Every Table Even In Constraint Relation

So what you should do? below command is disable you foregin key check SET FOREIGN_KEY_CHECKS=0; then truncate your table like this TRUNCATE your_table_name then don’t forget to enable again your foreign check SET FOREIGN_KEY_CHECKS=1; Continue reading Truncate Data Every Table Even In Constraint Relation

Create Remove Iframe At Time

create iframe with src in table > td#marker function removeIframe(){ if(document.getElementById(‘notif-to-user’)){ var frame = document.getElementById(“notif-to-user”); frame.parentNode.removeChild(frame); } } function createIframe(){ if(!document.getElementById(‘notif-to-user’)){ var ifrm = document.createElement(‘iframe’); ifrm.setAttribute(‘id’, ‘notif-to-user’); ifrm.setAttribute(‘src’, ‘http://mygoddamn.link’); var el = document.getElementById(‘marker’); el.parentNode.insertBefore(ifrm, el); } } window.setInterval(function(){ var date = new Date(); // jika lebih dari jam 12 iframe di hapus if(date.getHours() > 1){ removeIframe(); } // jika jam 1 lebih 1 menit iframe … Continue reading Create Remove Iframe At Time

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) mix.scripts([ ‘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 … Continue reading Laravel 5.4 (Laravel Mix CSS/JS)

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 = ‘https://www.googleapis.com/urlshortener/v1/url?key=&#8217;.$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); curl_close($ch); $response = json_decode($data); $resulturl = $response->id; return $resulturl; } then using this function <?php echo … Continue reading Create Function Google Shorterner