Definitely not comprehensive. This is meant to be a basic memory aid with links to get more details. I'll add to it over time.
$ npm install mongoose --save
const mongoose = require('mongoose');
* Promise vs Observable | |
* Promise | |
* Single async event that can either complete or fail once. | |
* Can be used with async/await keywords. | |
* Observable | |
* Can emit multiple events async. | |
* Offers a bit more control over the async task, for example cancelling. | |
* Cannot be used with async/await keywords. | |
* Think of Observables as a stream of data instead of an async task. | |
* Observable is the default used in Angular, but promises are still fine to use. |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
process.stdin.resume(); | |
process.stdin.setEncoding('ascii'); | |
var input_stdin = ""; | |
var input_stdin_array = ""; | |
var input_currentline = 0; | |
process.stdin.on('data', function (data) { | |
input_stdin += data; | |
}); |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>
var app = angular.module('app', ['firebase']); | |
app.controller('ctrl', function($scope) { | |
var ref = new Firebase('https://fbutil.firebaseio.com/paginate'); | |
$scope.scrollItems = $scrollArray(ref, 'number'); | |
}); | |
app.factory('$scrollArray', function($firebaseArray) { | |
return function(ref, field) { | |
// create a special scroll ref |
angular.module('app') | |
.controller('ImageUpload', ['$scope', '$log', | |
function ImageUpload($scope, $log) { | |
$scope.upload_image = function (image) { | |
if (!image.valid) return; | |
var imagesRef, safename, imageUpload; | |
image.isUploading = true; | |
imageUpload = { |