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
/* | |
* Vanilla JS - Touch Gestures | |
* @version 0.1 | |
* @inspired QuoJS - http://quojs.tapquo.com | |
* | |
* Supported Gestures: singleTap, doubleTap, hold, | |
* swipe, swiping, swipeLeft, swipeRight, swipeUp, swipeDown, | |
* rotate, rotating, rotateLeft, rotateRight, pinch, pinching, | |
* pinchIn, pinchOut, | |
* drag, dragLeft, dragRight, dragUp, dragDown |
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 (window, Element, undefined) { | |
'use strict'; | |
var prefix = '', | |
eventPrefix, | |
vendors = { Webkit: 'webkit', Moz: '', O: 'o', ms: 'MS' }, | |
document = window.document, | |
testEl = document.createElement('div'), | |
supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i, | |
transform, |
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
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
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
/** | |
* Reset | |
*/ | |
* { | |
-webkit-box-sizing: border-box; | |
-moz-box-sizing: border-box; | |
box-sizing: border-box; | |
} | |
html, body { |
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
angular.module('app').filter('characters', function () { | |
return function(input, chars) { | |
if (isNaN(chars)) return input; | |
if (chars <= 0) return ''; | |
if(input && input.length >= chars) { | |
input = input.substring(0, chars); | |
var lastspace = input.lastIndexOf(' '); | |
//get last space | |
if (lastspace !== -1) { | |
input = input.substr(0, lastspace); |
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
angular.module('app').filter("words", function() { | |
return function(input, words) { | |
if (isNaN(words)) return input; | |
if (words<=0) return ''; | |
if(input) { | |
var inputWords = input.split(/\s+/); | |
if (inputWords.length > words) { | |
input = inputWords.slice(0, words).join(' ') + '...'; | |
} | |
} |
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
/** | |
* @param {Scope} scope | |
* @param {Function} callback | |
*/ | |
angular.safeApply = function (scope, callback) { | |
scope[(scope.$$phase || scope.$root.$$phase) ? '$eval' : '$apply'](callback || function() {}); | |
}; |
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
/* Based on | |
* - EGM Mathematical Finance class by Enrique Garcia M. <egarcia@egm.co> | |
* - A Guide to the PMT, FV, IPMT and PPMT Functions by Kevin (aka MWVisa1) | |
*/ | |
var ExcelFormulas = { | |
PVIF: function(rate, nper) { | |
return Math.pow(1 + rate, nper); | |
}, |
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="Demo" ng-controller="AppController"> | |
<head> | |
<meta charset="utf-8" /> | |
<title> | |
Lazy Loading Images With AngularJS | |
</title> | |
<style type="text/css"> |