A Pen by Nariman Adam on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(var i=0;i<99999;i++){ | |
clearInterval(i); | |
clearTimeout(i); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html ng-app="chart"> | |
<head> | |
<meta name="description" content="Custom Directive Chart"> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
label{ | |
width:55px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Custom jQuery function. | |
// Determines if element is withing the viewport. | |
$.fn.inViewport = function() { | |
$el = this; | |
var elTop = $el.offset().top; | |
var elBot = elTop + $el.outerHeight(true); | |
var winScrollTop = $(window).scrollTop(); | |
var winHeight = $(window).height(); | |
var inViewport = winScrollTop <= elBot && (winScrollTop + winHeight) >= elTop; | |
return inViewport; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.directive('ngVisible', function () { | |
return function (scope, element, attr) { | |
scope.$watch(attr.ngVisible, function (visible) { | |
element.css('visibility', visible ? 'visible' : 'hidden'); | |
}); | |
}; | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add(num1, num2) { | |
num1 = num1.split(''); | |
num2 = num2.split(''); | |
num1 = num1.map(function (num) { | |
return parseInt(num, 10); | |
}); | |
num2 = num2.map(function (num) { | |
return parseInt(num, 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.addEventListener('install', function (event) { | |
event.waitUntil(preLoad()); | |
}); | |
var preLoad = function () { | |
// console.log('[PWA Builder] Install Event processing'); | |
return caches.open('pwabuilder-offline').then(function (cache) { | |
// console.log('[PWA Builder] Cached index and offline page during Install'); | |
return cache.addAll(['/offline.html', '/']); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$whatson: #ed8f25; | |
$whatsonBg: lighten($whatson, 20%); | |
$childcare: #7c398a; | |
$childcareBg: lighten($childcare, 40%); | |
$health: #9cc700; | |
$healthBg: lighten($health, 30%); | |
$shopping: #0065fd; | |
$shoppingBg: lighten($shopping, 30%); | |
$groups: #cb0033; | |
$groupsBg: lighten($groups, 50%); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns document meta description | |
*/ | |
getMetaDescription = function() { | |
var metas = document.getElementsByTagName('meta'); | |
for(var i in metas) { | |
if (typeof(metas[i].name) != 'undefined' && metas[i].name.toLowerCase() == "description") { | |
return encodeURIComponent(metas[i].content); | |
} | |
} |
OlderNewer