See also:
Service | Type | Storage | Limitations |
---|---|---|---|
Amazon DynamoDB | 25 GB | ||
Amazon RDS | |||
Azure SQL Database | MS SQL Server | ||
👉 Clever Cloud | PostgreSQL, MySQL, MongoDB, Redis | 256 MB (PostgreSQL) | Max 5 connections (PostgreSQL) |
See also:
Service | Type | Storage | Limitations |
---|---|---|---|
Amazon DynamoDB | 25 GB | ||
Amazon RDS | |||
Azure SQL Database | MS SQL Server | ||
👉 Clever Cloud | PostgreSQL, MySQL, MongoDB, Redis | 256 MB (PostgreSQL) | Max 5 connections (PostgreSQL) |
// The classic AJAX call - dispatch before the request, and after it comes back | |
function myThunkActionCreator(someValue) { | |
return (dispatch, getState) => { | |
dispatch({type : "REQUEST_STARTED"}); | |
myAjaxLib.post("/someEndpoint", {data : someValue}) | |
.then( | |
response => dispatch({type : "REQUEST_SUCCEEDED", payload : response}), | |
error => dispatch({type : "REQUEST_FAILED", error : error}) | |
); |
// format number as currency | |
export function formatCurrency(amount) { | |
return new Intl.NumberFormat(`en-US`, { | |
style: "currency", | |
currency: "USD", | |
minimumFractionDigits: 2, | |
}).format(amount); | |
} |
inOrderDFS(){ | |
// a variable to store the visited nodes | |
let result = [] | |
// helper function -- accepts a node | |
function traverse(node){ | |
// if node has left, recursion to find the leftest leaf node | |
if(node.left) traverse(node.left) | |
// push the node to the result | |
result.push(node) | |
// if node has right, recurstion to find the rightest leaf node |
<template name="ngf" value="(function () { 'use strict'; /** * * @author $name$ * @date $date$ * * @name * $module$:$factoryName$ * * @param {obj} $value1$ An accessible member * @param {function} $function1$ A function the Factory returns * @param {function} $function2$ A function the Factory returns * * // define module requirements * @requires $dependancy1$ * @requires $dependancy2$ * * // define `imports` * @requires $import1$ * @requires $import2$ * * @description $description$ * Trying to follow the style guidelines from: {https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#angular-docs Angular 1 Style Guide <br> * */ // Ideally each Directive will have a unique package, so this try, catch won`t be required <br> |
<template name="ngsd" value="(function () { 'use strict'; /** * * @author $name$ * @date $date$ * * @name * $module$:$directiveName$ * * @param {data} $input1$ An input two-way binding * @param {function} $function1$ An output function * * @description $description$ * Trying to follow the style guidelines from: {https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#angular-docs Angular 1 Style Guide <br> * @example <pre> <$nameDash$ $inputDash1$='data' $functionDash1$='update'> <$nameDash$/> <pre> * */ try { module = angular.module('$module$'); } catch (err) { module = angular.module('$module$', []) } module.directive('$directiveName$', $directiveNa |
// see: http://stackoverflow.com/questions/1354064/how-to-convert-characters-to-html-entities-using-plain-javascript | |
// TODO move to $filters | |
var escapeHtmlEntities = function(text) { | |
return text.replace(/[\u00A0-\u2666<>\&]/g, function(c) { | |
return '&' + | |
(escapeHtmlEntities.entityTable[c.charCodeAt(0)] || '#' + c.charCodeAt(0)) + ';'; | |
}); | |
}; | |
// the wrong kind of entities for our purpose but worth keeping |
{ | |
"globalstrict": true, | |
"globals": { | |
"this" : false, | |
"localStorage": false, | |
"angular": true, | |
"Firebase": true, | |
"Modernizr": true, | |
"moment" : true, | |
"tool" : true, |
{ | |
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch", "case", "default"], | |
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], | |
"requireParenthesesAroundIIFE": true, | |
"requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, | |
"disallowSpacesInFunctionExpression": { "beforeOpeningRoundBrace": true }, | |
"requireMultipleVarDecl": true, | |
"disallowEmptyBlocks": true, | |
"disallowSpacesInsideObjectBrackets": true, | |
"disallowSpacesInsideArrayBrackets": true, |