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 datetime | |
import pymongo | |
client = pymongo.MongoClient("mongodb://<user>:<password>@<host>:<port>/<db_namespace>") | |
def save_data_to_mongo(data): | |
db = client["<db_namespace>"] | |
collection = db["test_data"] | |
response = collection.insert_one(data) |
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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package testui; | |
//Import required packages | |
import java.sql.*; |
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
src | |
|_components | |
| |_counter.js | |
| | |
|_screens | |
| |_main_screen.js | |
| | |
|_store | |
|_actions | |
| |_action_types.js |
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, { Component } from 'react'; | |
import { View, Text, StyleSheet, TouchableOpacity } from 'react-native'; | |
import { connect } from 'react-redux'; | |
import { counterAdd, counterSubtract } from '../store/actions/index'; | |
import CounterComponent from '../components/counter'; | |
class MainScreen extends Component { |
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, { Component } from "react"; | |
import { View, Text, StyleSheet } from "react-native"; | |
import { connect } from "react-redux"; | |
class CounterComponent extends Component { | |
constructor(props) { | |
super(props); | |
this.state = {}; | |
} |
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
export { counterAdd, counterSubtract } from './counter_actions'; |
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 { COUNTER_ADD, COUNTER_SUBTRACT } from "./action_types"; | |
export const counterAdd = () => { | |
return { | |
type: COUNTER_ADD | |
}; | |
} | |
export const counterSubtract = () => { | |
return { |
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
export const COUNTER_ADD = 'COUNTER_ADD'; | |
export const COUNTER_SUBTRACT = 'COUNTER_SUBTRACT'; |
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'; // Remember to import React | |
import { AppRegistry } from 'react-native'; | |
import { Provider } from 'react-redux'; | |
import {name as appname} from './app.json'; | |
import Application from './src/app'; | |
import configStore from './src/store/config_store'; | |
const store = configStore(); |
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 { createStore, combineReducers } from 'redux'; | |
import counterReducer from './reducers/counter_reducer'; | |
const rootReducer = combineReducers({ | |
counter: counterReducer, | |
}); | |
const configStore = () => { | |
return createStore(rootReducer); | |
}; |
NewerOlder