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
API_URL=https://[yourdomain]/wp-json/v2/ |
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 Config from 'react-native-config'; | |
export const fetchApiData = async route => { | |
try { | |
const response = await fetch(Config.API_URL + route); | |
const json = await response.json(); | |
return json; | |
} catch (error) { | |
console.error(error); | |
return null; |
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, { useEffect, useState } from 'react'; | |
import { FlatList, SafeAreaView, Text } from 'react-native'; | |
import PropTypes from 'prop-types'; | |
import { fetchApiData } from '../../lib/api'; | |
const Posts = ({ navigation }) => { | |
const [posts, setPosts] = useState([]); | |
const [page, setPage] = useState(1); | |
const [loading, setLoading] = useState(true); |
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
... | |
WP_USERNAME=[username] | |
WP_PASSWORD=[password] |
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 base64 from 'react-native-base64'; | |
... | |
const auth = base64.encode(`${Config.WP_USERNAME}:${Config.WP_PASSWORD}`); | |
export const updateData = async (route, data) => { | |
try { | |
fetch(Config.API_URL + route, { | |
method: 'POST', |
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
from pyspark.sql import SparkSession | |
from pyspark.sql.functions import explode, split, to_timestamp | |
TS_FORMAT = "yyyy-MM-dd HH:mm:ss" | |
checkins_path = ... | |
tips_path = ... | |
spark = SparkSession.builder.master("local").appName("preprocessing").getOrCreate() |
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
# Hops | |
import hsfs | |
from hops import hdfs | |
# Spark | |
from pyspark.sql import DataFrame, SQLContext | |
from pyspark.sql.functions import col, lit | |
# Implementations | |
from hops.pit import PitContext | |
# SparkMeasure | |
from sparkmeasure import StageMetrics |
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
# Hops | |
import hsfs | |
from hops import hdfs | |
# Spark | |
from pyspark.sql import DataFrame, SQLContext | |
from pyspark.sql.functions import col, lit | |
# Implementations | |
from hops.pit import PitContext | |
# SparkMeasure | |
from sparkmeasure import StageMetrics |