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
// In the MongoDB Aggregation Pipeline, each stage is represented by an object. | |
// The type of stage must be one MongoDB's predefined stage types. There are | |
// a variety of stage types, but some of the most useful are: $match, $group, | |
// $project, and $sort. See the MongoDB manual for an exhaustive list. | |
// Lets look at some examples to see how each works. Then, we'll put them | |
// together in the pipeline. | |
// Lets say we have a database of kittens with various information about each. | |
// A match stage might look like this: |
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
// What the difference between: | |
function declaration() {}; // This is a function declaration | |
// and | |
var expression = function() {}; // This is a function expression | |
// The function declaration is hoisted, definition and all. | |
// In the expression, only the var declaration is hoisted. |
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 addStar = function(data) { | |
return $http({ | |
method: 'POST', | |
url: '/api/collection/addStar', | |
data: data | |
}).then(function(response) { | |
return response.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
// a flag to toggle asset pipeline / compass integration | |
// defaults to true if twbs-font-path function is present (no function => twbs-font-path('') parsed as string == right side) | |
// in Sass 3.3 this can be improved with: function-exists(twbs-font-path) | |
$bootstrap-sass-asset-helper: (twbs-font-path("") != unquote('twbs-font-path("")')) !default; | |
// | |
// Variables | |
// -------------------------------------------------- | |
//== Colors |
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 memoize(func, resolver) { | |
var memoized = function() { | |
var cache = memoized.cache; | |
var key = resolver ? | |
resolver.apply(this, arguments) : | |
arguments[0]; | |
if (cache.has(key)) { | |
return cache.get(key); | |
} |