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
module.exports = { | |
ENV: 'set by development.js', | |
ARG: 'set by development.js', | |
DEV: 'set by development.js' | |
}; |
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 renameProperty(object, oldKey, newKey) { | |
if (object instanceof Object && object.hasOwnProperty(oldKey) && oldKey !== newKey) { | |
Object.defineProperty(object, newKey, | |
Object.getOwnPropertyDescriptor(object, oldKey)); | |
delete object[oldKey]; | |
} | |
} |
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('behaviour', []) | |
.factory('behaviours', behavioursFactory) | |
; | |
behavioursFactory.$inject = ['$http']; | |
function behavioursFactory($http) { | |
var behaviours; | |
$http.get('data.json').then(function(res) { | |
behaviours = res.data; |
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 delay(millis) { | |
var start = new Date().getTime(); | |
var end = start + millis; | |
var current; | |
do { | |
current = new Date().getTime(); | |
} while(current < end); | |
} |
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 () { | |
'use strict'; | |
angular.module('myApp', ['restangular']) | |
.config(httpConfig) | |
; | |
function httpConfig($httpProvider) { | |
$httpProvider.interceptors.unshift(interceptor); // use unshift to run before Restangular's interceptor |
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
# simple match all query with term facet | |
ejs.Request() | |
.indices("myindex") | |
.types("mytype") | |
.query(ejs.MatchAllQuery()) | |
.facet( | |
ejs.TermsFacet('url') | |
.field('url') | |
.size(20)) |
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
@mixin dropShadow($offX: 2, $offY: 2, $blur: 2, $rgba: rgba(0, 0, 0, 0.3), $hex: #B2B2B2) { | |
-webkit-filter: drop-shadow(#{$offX}px #{$offY}px #{$blur}px $rgba); | |
filter : url("data:image/svg+xml;utf8,<svg height='0' xmlns='http://www.w3.org/2000/svg'><filter id='drop-shadow'><feGaussianBlur in='SourceAlpha' stdDeviation='" + $blur +"'/><feOffset dx='" + $offX + "' dy='" + $offY + "' result='offsetblur'/><feFlood flood-color='#{$rgba}'/><feComposite in2='offsetblur' operator='in'/><feMerge><feMergeNode/><feMergeNode in='SourceGraphic'/></feMerge></filter></svg>#drop-shadow"); | |
-ms-filter : "progid:DXImageTransform.Microsoft.Dropshadow(OffX=" + $offX + ", OffY=" + $offY + ", Color='" + $hex + "')"; | |
filter : "progid:DXImageTransform.Microsoft.Dropshadow(OffX=" + $offX + ", OffY=" + $offY + ", Color='" + $hex + "')"; | |
} |
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 gulp = require('gulp'); // https://www.npmjs.com/package/gulp | |
var plato = require('plato'); // https://www.npmjs.com/package/plato | |
var open = require('open'); // https://www.npmjs.com/package/open | |
// Override defaults by setting node environment variables: $ SRC='./js/**/*.*' DEST='./info' gulp report | |
var src = process.env.SRC || './src/**/*.*'; | |
var dest = process.env.DEST || './report'; | |
gulp.task('report', function() { | |
plato.inspect(src, dest, {}, callback); |
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(angular) { | |
'use strict'; | |
var module = angular.module('sscovil.parallax', []); | |
// Requires jQuery for retreiving computed background-position from angular.element objects | |
// Alternative would be to use: window.getComputedStyle(scrollElem, null).backgroundPosition | |
module.directive('parallaxBackground', function($window) { | |
return { | |
restrict: 'A', |
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 isPrime(n) { | |
// Eliminate any non-numeric values | |
if (typeof(n) === 'boolean' || n === null || isNaN(n)) | |
return false; | |
// Handle first two prime numbers | |
if (n === 2 || n === 3) | |
return true; | |
// Handle numbers that are definitely not prime |