Skip to content

Instantly share code, notes, and snippets.

View hyyan's full-sized avatar

Hyyan Abo Fakher hyyan

View GitHub Profile
@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>
@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();
}