#Simple Firebase Rules Stack
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"; | |
var _theme; | |
angular | |
.module('mdColors',['mdColors']) | |
.config(['$mdThemingProvider', function($mdThemingProvider){ | |
_theme = $mdThemingProvider.theme(); |
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
{ | |
"estadoPorDdd": { | |
"11": "SP", | |
"12": "SP", | |
"13": "SP", | |
"14": "SP", | |
"15": "SP", | |
"16": "SP", | |
"17": "SP", | |
"18": "SP", |
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
import React, { PropTypes } from 'react'; | |
import MDialog from 'material-ui/Dialog'; | |
import './dialog.css'; | |
const Dialog = props => ( | |
<MDialog | |
{...props} | |
repositionOnUpdate={false} | |
autoDetectWindowHeight={false} |
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
// Lembre de rodar: npm i firebase | |
const firebase = require("firebase"); | |
const exec = require("child_process").exec; | |
var config = { | |
// Sua configuração do firebase | |
}; | |
const firebaseApp = firebase.initializeApp(config); | |
const ref = firebaseApp.database().ref(); |
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
// Indicates if a user is logged in | |
imLoggedIn() { | |
auth != null | |
} | |
// Checks for the correc user id | |
myUidIs(uid) { | |
imLoggedIn() && auth.uid == uid | |
} |
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
{ | |
"rules": { | |
"users": { | |
".read": "auth != null && auth.uid == 'SERVER'", | |
"$userId": { | |
".validate": "newData.hasChildren(['displayName', 'age'])", | |
"displayName": { | |
".validate": "newData.isString()" | |
}, | |
"age": { |
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
{ | |
"root": { | |
"users": { | |
"RICK": { | |
"displayName": "Rick Sanchez", | |
"age": 60 | |
}, | |
"MORTY": { | |
"displayName": "Morty Smith", | |
"age": 14 |
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
import React from 'react'; | |
import { inject } from 'unstated'; | |
import CounterContainer from './CounterContainer.js'; | |
const Counter = ({ counter }) => ( | |
<div> | |
<button onClick={() => counter.decrement()}>-</button> | |
<span>{counter.state.count}</span> | |
<button onClick={() => counter.increment()}>+</button> | |
</div> |