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) |
import { Entypo, Feather } from '@expo/vector-icons'; | |
import faker from 'faker'; | |
import * as React from 'react'; | |
import { Dimensions, FlatList, Text, TouchableOpacity, View } from 'react-native'; | |
const { width, height } = Dimensions.get('screen'); | |
faker.seed(10); | |
const data = [...Array(20).keys()].map(() => ({ |
function sleep(delay) { | |
var start = new Date().getTime(); | |
while (new Date().getTime() < start + delay) ; | |
} | |
function convertTime(hours) { | |
var realHours = Math.floor(hours); | |
var minutes = (hours - realHours) * 60; | |
var realMinutes = Math.round(minutes); | |
var realSeconds = ((hours - realHours) + (minutes - realMinutes)) * 60; |
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) |
If you are using Firebase on a Spark (free) plan, you can only make outbound networking requests to Google services. Unfortunately, that does not include Web app deployed from App Script (script.google.com/macros/s/.../exec). (Stackoverflow #43330192)
This is a crude example showing how to execute Apps Script using the scripts.run
method of Apps Script API.
In this example, the Firebase app does not store the user's OAuth id token, does not validate the access token (e.g. the access token is issued for your project, not someone else's), and does not store the refresh token (access token will expire 60min after issue if not refreshed). For production, these issues must be resolved.
var count =Math.floor(Math.random()*100); | |
process.on('message', (msg)=>{ | |
console.log("CHILD: message received from parent process", msg); | |
count = parseInt(msg) +1; | |
console.log("CHILD: +1 from child"); |
service: service-name | |
provider: | |
name: aws | |
runtime: nodejs6.10 | |
functions: | |
myfunc: | |
handler: handler.myfunc |
import firebase from 'firebase' | |
import { filter, map } from 'lodash' | |
import { makeExecutableSchema } from 'graphql-tools' | |
firebase.initializeApp({ | |
databaseURL: 'https://grafire-b1b6e.firebaseio.com', | |
}) | |
const mapSnapshotToEntity = snapshot => ({ id: snapshot.key, ...snapshot.val() }) | |
const mapSnapshotToEntities = snapshot => map(snapshot.val(), (value, id) => ({ id, ...value })) |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
Not all random values are created equal - for security-related code, you need a specific kind of random value.
A summary of this article, if you don't want to read the entire thing:
Math.random()
. There are extremely few cases where Math.random()
is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.crypto.getRandomBytes
directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.uuid
, specifically the uuid.v4()
method. Avoid node-uuid
- it's not the same package, and doesn't produce reliably secure random values.random-number-csprng
.You should seriously consider reading the entire article, though - it's