<button>Let's Go !</button>
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 ProjectList from './projects/ProjectList'; | |
import { Route, Switch, Redirect } from 'react-router-dom'; | |
import './App.css'; | |
import Navbar from './layout/Navbar'; | |
import Home from './Home/Home'; | |
import Dashboard from './dashboard/Dashboard'; | |
import Profile from './profile/Profile'; | |
import TaskLayout from './tasks/TaskLayout'; | |
import Four04 from './core/Four04'; |
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
router.get('/:page', (req, res) => { | |
let limit = 50; // number of records per page | |
let offset = 0; | |
db.user.findAndCountAll() | |
.then((data) => { | |
let page = req.params.page; // page number | |
let pages = Math.ceil(data.count / limit); | |
offset = limit * (page - 1); | |
db.user.findAll({ | |
attributes: ['id', 'first_name', 'last_name', 'date_of_birth'], |
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
const getErrorMessage = err => { | |
let message = ''; | |
if (err.code) { | |
switch (err.code) { | |
case 11000: | |
case 11001: | |
message = getUniqueErrorMessage(err); | |
break; | |
default: | |
message = 'Something went wrong.'; |
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
'use strict'; | |
module.exports = function(sequelize, DataTypes) { | |
var user = sequelize.define('user', { | |
id:{ | |
allowNull: false, | |
autoIncrement: true, | |
primaryKey: true, | |
type: DataTypes.INTEGER | |
}, | |
username: DataTypes.INTEGER, |
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
HomeNavigator.navigationOptions = ({ navigation }) => { | |
let tabBarVisible = true | |
if (navigation.state.routes.some(route => route.routeName === "Camera")) { | |
tabBarVisible = false | |
} | |
if (navigation.state.routes.some(route => route.routeName === "Map")) { | |
tabBarVisible = false | |
} | |
return { | |
tabBarVisible |
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
// Dependencies ========================= | |
var | |
twit = require('twit'), | |
config = require('./config'); | |
var Twitter = new twit(config); | |
// RETWEET BOT ========================== |
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
saveTodos = newToDos => { | |
const saveTodos = AsyncStorage.setItem('todos', JSON.stringify(newToDos)) | |
} | |
addTodo = newTask => { | |
const newTodoItem = newTask | |
if (newTodoItem !== '') { | |
this.setState(prevState => { | |
const ID = uuidv1() | |
const newToDoObject = { | |
[ID]: { |
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 Segment from Native Base | |
import { Button, Text as NBText, Segment } from 'native-base' | |
// inside the render method... | |
const { isDataReady, filter } = this.state | |
// just before flatlist add a new view | |
<View style={styles.contentHeader}> |
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
state = { | |
isDataReady: false, | |
mockItems: ['First Item', 'Second Item', 'Third Item'] | |
} |