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('foo', []) | |
.filter('timeAgo', function() { | |
return function(s) { | |
var d = new Date(s); | |
var seconds = Math.floor((new Date() - d) / 1000); | |
var interval = Math.floor(seconds / 31536000); | |
if (interval > 1) {return interval + " years ago";} | |
if (interval === 1) {return interval + " year ago";} |
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
- var randomContent = function(config){ | |
- var RandomContentConfig = function(config){ //- override defaults with passed in config | |
- var config = config || {}; | |
- this.type = config.type || 'text'; | |
- this.min = config.min || 10; | |
- this.max = config.max || 100; | |
- this.punctuation = typeof(config.punctuation) !== 'undefined' ? config.punctuation : true; | |
- }; | |
- var puncChance = .0001; | |
- var c = new RandomContentConfig(config); //- config object |
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
Date.prototype.toMMDDYYYY = function (key) { | |
function f(n) { | |
// Format integers to have at least two digits. | |
return n < 10 ? '0' + n : n; | |
} | |
return f(this.getUTCMonth() + 1) + '/' + | |
f(this.getUTCDate()) + '/' + | |
this.getUTCFullYear(); | |
}; |
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
Date.prototype.timeAgo = function(){ | |
var seconds = Math.floor((new Date() - this) / 1000); | |
var interval = Math.floor(seconds / 31536000); | |
if (interval > 1) {return interval + " years";} | |
if (interval === 1) {return interval + " year";} | |
interval = Math.floor(seconds / 2592000); | |
if (interval > 1) { return interval + " months";} | |
if (interval === 1) {return interval + " month";} |
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 ($) { | |
var $window = $(window); | |
var windowHeight = $window.height(); | |
var Parallax = function (element, options) { | |
var $this = $(element); | |
var $img = $this.find('img:first'); | |
var obj = this; | |
var thisTop, maxOffset, thisHeight; | |
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
/******************************************************************************* | |
* Global data service utility "class" | |
*******************************************************************************/ | |
NAMESPACE.DataService = function(){ | |
var foo = { | |
set : function(obj, callback, errorConfig){ | |
var payload = JSON.stringify(obj), | |
config = { | |
url: '/foo/update/', |
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
@import "grid_settings"; | |
* { | |
-webkit-box-sizing: border-box; /* Android ≤ 2.3, iOS ≤ 4 */ | |
-moz-box-sizing: border-box; /* Firefox 1+ */ | |
box-sizing: border-box; /* Chrome, IE 8+, Opera, Safari 5.1 */ | |
} | |
/* The Grid ---------------------- */ |