Coding HTML5/Javascript Linear Gauge without any libraray
A Pen by Hyyan Abo Fakher on CodePen.
/* Attribution: http://techslides.com/how-to-parse-and-search-json-in-javascript */ | |
//return an array of objects according to key, value, or key and value matching | |
function getObjects(obj, key, val) { | |
var objects = []; | |
for (var i in obj) { | |
if (!obj.hasOwnProperty(i)) continue; | |
if (typeof obj[i] == 'object') { | |
objects = objects.concat(getObjects(obj[i], key, val)); | |
} else |
function format(date, format) { | |
if (!date || !format) { | |
return; | |
} | |
if (format.toLowerCase() === "short") { | |
format = "dd-MM-yyyy"; | |
} | |
if (format.toLowerCase() === "medium") { | |
format = "dd-MM-yyyy hh:mm:ss"; | |
} |
Coding HTML5/Javascript Linear Gauge without any libraray
A Pen by Hyyan Abo Fakher on CodePen.
<div class="tools"> | |
<label> | |
Bruch Color | |
<input id="color" type="color" value="#f00" /> | |
</label> | |
<label> | |
Bruch Size | |
<input id="size" type="number" value="10" /> | |
</label> |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Service Workers</title> | |
<link rel="stylesheet" href="index.css"> | |
</head> | |
<body> | |
<h1>Service Workers Rocks</h1> | |
<button id="updateButton" style="display: none">Update Now</button> |
let cacheName = 'cache-v1'; | |
self.addEventListener('install', (e) => { | |
let cache = caches.open(cacheName).then((c) => { | |
c.addAll([ | |
'/index.css' | |
]); | |
}); |
<?php | |
require_once 'vendor/autoload.php'; | |
use Jaguar\Canvas, | |
Jaguar\Transformation, | |
Jaguar\Action\Color\Boost, | |
Jaguar\Action\Blur\SelectiveBlur, | |
Jaguar\Action\Posterize, | |
Jaguar\Action\EdgeDetection; |
<?php | |
require_once 'vendor/autoload.php'; | |
use Jaguar\Canvas, | |
Jaguar\Transformation, | |
Jaguar\Action\Color\Grayscale, | |
Jaguar\Action\EdgeDetection, | |
Jaguar\Action\Color\Negate; |
Simple CSS3 Masonry Grid , which can be used to create image gallery or to display posts grid wih no Javascript
A Pen by Hyyan Abo Fakher on CodePen.
/** Break html5 cart caching */ | |
add_action('wp_enqueue_scripts', 'cartcache_enqueue_scripts', 100); | |
function cartcache_enqueue_scripts() | |
{ | |
wp_deregister_script('wc-cart-fragments'); | |
wp_enqueue_script( 'wc-cart-fragments', get_template_directory_uri() . '/cart-fragments.js', array( 'jquery', 'jquery-cookie' ), '1.0', true ); | |
} |