This file contains hidden or 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
{ | |
"name": "cibo_property_system", | |
"version": "0.0.1", | |
"engines": { | |
"node": "6.2.0", | |
"npm": "3.8.9" | |
}, | |
"description": "This is the property management system for cibo by Launch Design", | |
"main": "index.js", | |
"scripts": { |
This file contains hidden or 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
// load jquery and foundation in the window scope | |
import 'script-loader!jquery' | |
import 'script-loader!what-input' | |
import 'script-loader!foundation-sites' | |
require('./styles/app.scss'); |
This file contains hidden or 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
ERROR in ./~/css-loader!./~/sass-loader/lib/loader.js!./src/styles/app.scss | |
Module build failed: | |
@import 'util/util'; | |
^ | |
File to import not found or unreadable: util/util. | |
Parent style sheet: /Users/zacck/Documents/www/cibo/src/styles/base/_foundation-settings.scss | |
in /Users/zacck/Documents/www/cibo/src/styles/base/_foundation-settings.scss (line 43, column 1) | |
@ ./src/styles/app.scss 4:14-125 13:2-17:4 14:20-131 | |
@ ./src/app.jsx | |
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server script-loader!jquery/dist/jquery.min.js script-loader!foundation-sites/dist/js/foundation.min.js ./app.jsx |
This file contains hidden or 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
// you can write to stdout for debugging purposes, e.g. | |
// console.log('this is a debug message'); | |
function solution(A) { | |
// write your code in JavaScript (Node.js 6.4.0) | |
//number of pairs | |
var pairs = 0; | |
//TODO use recursion. | |
//map through array | |
A.map((item, pos, itemArray) => { |
This file contains hidden or 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
// you can write to stdout for debugging purposes, e.g. | |
// console.log('this is a debug message'); | |
function solution(N) { | |
if(N <= 0){ | |
return 1 | |
} | |
else | |
{ | |
//get a set of our digits |
This file contains hidden or 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
// you can write to stdout for debugging purposes, e.g. | |
// console.log('this is a debug message'); | |
function solution(S) { | |
// write your code in JavaScript (Node.js 6.4.0) | |
var numericString = S.trim; | |
var finalString = ''; | |
//lets remove all the non numeric characters in the string | |
numericString = S.replace(/\s|-/g, ''); | |
//we removed the chuff ensure we have more than 2 characters |
This file contains hidden or 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
var request = require('request'); | |
module.exports = function (ctx, req, res) { | |
request({url: 'http://ipinfo.io/', json:true}, (error, response, body) => { | |
//do we have an error guessing location of user | |
if(error) { | |
//an error occured lets alert user | |
res.writeHead(200, {'Content-Type': 'text/html'}); | |
res.end(`<p style="text-align: center">Unable to guess your Location ${error} Occured</p>`); | |
} else { | |
// if we have a response body.city will have our city lets use this |
This file contains hidden or 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
//add login async action generator | |
export var startLogin = () => { | |
return(dispatch, state) => { | |
//lets use googleauth to auth the user | |
return firebase.auth().signInWithPopup(googleAuthProvider).then((result) => { | |
console.log('auth success') | |
}, (error) => { | |
//deal with errors if any | |
var errorCode = error.code; | |
var errorMessage = error.message; |
This file contains hidden or 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
if(auth != undefined) | |
{ | |
//check that user doesnt exist | |
firebaseRef.child(`users/${auth.uid}`).once('value').then((userShot) => { | |
if(userShot.val() == null) { | |
var userFanOut = {} | |
userFanOut[`/users/${auth.uid}`] = auth; | |
return firebaseRef.update(userFanOut).then(() => { | |
hashHistory.push('/app'); | |
}) |