Skip to content

Instantly share code, notes, and snippets.

View azhsetiawan's full-sized avatar
🚬
black sebat

Ashar azhsetiawan

🚬
black sebat
View GitHub Profile
@azhsetiawan
azhsetiawan / ConvertMS.js
Created July 23, 2021 11:58 — forked from flangofas/ConvertMS.js
JS: Convert Milliseconds to days? minutes? seconds? or all!
function convertMiliseconds(miliseconds, format) {
var days, hours, minutes, seconds, total_hours, total_minutes, total_seconds;
total_seconds = parseInt(Math.floor(miliseconds / 1000));
total_minutes = parseInt(Math.floor(total_seconds / 60));
total_hours = parseInt(Math.floor(total_minutes / 60));
days = parseInt(Math.floor(total_hours / 24));
seconds = parseInt(total_seconds % 60);
minutes = parseInt(total_minutes % 60);
@azhsetiawan
azhsetiawan / dns-prefetch.php
Created June 7, 2016 17:28 — forked from leogopal/dns-prefetch.php
DNS Prefetching in WordPress
<?php
// Prefetch For Speed Up
function dns_prefetch() {
$prefetch = 'on';
echo "\n <!-- DNS Prefetching Start --> \n";
echo '<meta http-equiv="x-dns-prefetch-control" content="'.$prefetch.'">'."\n";
if ($prefetch != 'on') {