Skip to content

Instantly share code, notes, and snippets.

View zacck-zz's full-sized avatar
Lemur Heavy

Zacck Osiemo zacck-zz

Lemur Heavy
View GitHub Profile
import {firebaseRef} from '../firebase/index';
//export async action to start add table
export var startAddTable = (table) => {
return(dispatch, getState) => {
var propId = getState().property.key;
//get propid
var tableFanOut = {};
var tableKey = firebaseRef.child('tables').push().key;
tableFanOut[`/tables/${tableKey}`] = table;
tableFanOut[`/property-tables/${propId}/${tableKey}`] = tableKey;
remote: Total precache size is about 3.73 MB for 29 resources.
remote: Hash: fa3175ac800b11e030e2
remote: Version: webpack 3.4.1
remote: Time: 58465ms
remote: Asset Size Chunks Chunk Names
remote: 13.fa3175ac800b.bundle.js 2.29 kB 13 [emitted]
remote: 1b35dcaaed2aee19d08d6167bda5f588.png 8.89 kB [emitted]
remote: 1.fa3175ac800b.bundle.js 1.64 kB 1 [emitted]
remote: 2.fa3175ac800b.bundle.js 496 kB 2 [emitted] [big]
remote: 3.fa3175ac800b.bundle.js 530 kB 3 [emitted] [big]
import firebase, {firebaseRef, googleAuthProvider, storageRef} from '../firebase';
import {reset} from 'redux-form';
import { addProperty } from 'propertyActions';
import {collectUserProperties} from 'userPropertiesActions';
//add login action
export var login = (user) => {
return {
type: 'LOGIN',
user
};
import configureMockStore from 'redux-mock-store'
import expect from 'expect'
import thunk from 'redux-thunk'
import firebase,{firebaseRef} from 'src/firebase/index'
import * as actions from 'authActions'
import shortid from 'shortid'
//use this to mock a store
import {injectGlobal} from 'styled-components';
import Roboto from '../assets/Roboto-Black.ttf';
export default function() {
injectGlobal`
@font-face {
font-family: 'Roboto';
src: url(${Roboto});
}
body {
font-family: Roboto;
user1 = %{name: "Zacck", account_type: "Free"}
user2 = %{name: "Carla", account_type: "Paid"}
def validate(user) do
if user.account_type == "Paid" do
true
else
false
end
end
def validate(user) do
validate(user, user.account_type)
end
def validate(user, "Free") do
allowgoldcoins(user.name, false)
false
end
def validate(user, "Paid") do
defmodule Math do
@moduledoc """
Bogus implementation of trivial calculations for
testing examples
"""
@doc ~S"""
Does some trivial calculations
defmodule MathTest do
use ExUnit.Case, async: true
doctest Math
end
defmodule Application.Profile do
alias Application.Person
@doc ~S"""
This prints the persons profile
"""
def log(%Person{} = person) do
IO.puts person
end
end