Skip to content

Instantly share code, notes, and snippets.

View hyyan's full-sized avatar

Hyyan Abo Fakher hyyan

View GitHub Profile
@hyyan
hyyan / ngEnter.js
Last active August 29, 2015 14:15 — forked from EpokK/ngEnter.js
app.directive('ngEnter', function() {
return function(scope, element, attrs) {
element.bind("keydown keypress", function(event) {
if(event.which === 13) {
scope.$apply(function(){
scope.$eval(attrs.ngEnter);
});
event.preventDefault();
}
@hyyan
hyyan / maintenance.php
Created March 8, 2015 13:12
maintenence mode page
<?php
$protocol = $_SERVER["SERVER_PROTOCOL"];
if ('HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol)
$protocol = 'HTTP/1.0';
header("$protocol 503 Service Unavailable", true, 503);
header('Content-Type: text/html; charset=utf-8');
header('Retry-After: 3600');
?>
<html>
<head>
/** 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 );
}
@hyyan
hyyan / css3-masonry-grid.markdown
Created October 29, 2016 20:02
CSS3 Masonry Grid

CSS3 Masonry Grid

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.

License.

<?php
require_once 'vendor/autoload.php';
use Jaguar\Canvas,
Jaguar\Transformation,
Jaguar\Action\Color\Grayscale,
Jaguar\Action\EdgeDetection,
Jaguar\Action\Color\Negate;
<?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;
let cacheName = 'cache-v1';
self.addEventListener('install', (e) => {
let cache = caches.open(cacheName).then((c) => {
c.addAll([
'/index.css'
]);
});
@hyyan
hyyan / index.html
Last active November 11, 2017 22:50
<!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>
@hyyan
hyyan / index.html
Created April 26, 2018 20:24
Simple Javascript Painter Demo
<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>
@hyyan
hyyan / coding-html5-javascript-linear-gauge.markdown
Created April 26, 2018 20:41
Coding HTML5/Javascript Linear Gauge