- https://guides.github.com/activities/hello-world/
- https://guides.github.com/introduction/getting-your-project-on-github/
- https://help.github.com/articles/github-glossary/
- https://code.visualstudio.com/docs/editor/versioncontrol
- https://gist.github.com/brygrill/b99fd518cf07c3424c94e9ed37a471ff
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
name: CI | |
on: [push] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-18.04 | |
strategy: | |
matrix: |
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
module.exports = { | |
extends: [ | |
'airbnb-typescript', | |
'airbnb/hooks', | |
'plugin:@typescript-eslint/recommended', | |
'plugin:jest/recommended', | |
'plugin:prettier/recommended' | |
], | |
plugins: ['react', '@typescript-eslint', 'jest'], | |
env: { |
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 axios from 'axios'; | |
const userItemsBase = 'https://www.arcgis.com/sharing/rest/content/users'; | |
export const fetchUserContent = async (token, username) => { | |
const { data } = await axios.get(`${userItemsBase}/${username}`, { | |
params: { | |
token, | |
f: 'json', | |
}, |
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 App = () => { | |
// state | |
const [authed, setAuthed] = useState(false); | |
const [token, setToken] = useState(null); | |
const [user, setUser] = useState(null); | |
// functions | |
const removeHash = () => { | |
window.history.pushState('', document.title, window.location.pathname); | |
}; |
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
// App.js | |
const App = () => { | |
// state | |
const [authed, setAuthed] = useState(false); | |
// render | |
// if not authed display signin page | |
if (!authed) { | |
return <SignIn />; |
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
// mock data | |
const data = [ | |
{ vehicleid: 1, latitude: 40.1, longitude: -76.5 }, | |
{ vehicleid: 2, latitude: 40.2, longitude: -76.6 }, | |
{ vehicleid: 3, latitude: 40.3, longitude: -76.7 } | |
] | |
const resolvers = { | |
Coordinates: new GraphQLScalarType({ | |
name: 'Coordinates', |
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
new GraphQLScalarType({ | |
// Thanks: | |
// https://github.com/ghengeveld/graphql-geojson/blob/master/index.js#L46 | |
// https://github.com/apollographql/graphql-tools/blob/master/docs/source/scalars.md | |
name: 'Coordinates', | |
description: 'A set of coordinates. x, y', | |
parseValue(value) { | |
return value; | |
}, | |
serialize(value) { |
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 typeDefs = ` | |
scalar Coordinates | |
type PointGeometry { | |
type: String! | |
coordinates: Coordinates! | |
} | |
type PointProps { | |
id: Int! |
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
// via https://github.com/firebase/functions-samples/blob/master/quickstarts/big-ben/functions/index.js | |
const functions = require('firebase-functions'); | |
// endpoint would be the <the url firebase gives you>/bigben | |
exports.bigben = functions.https.onRequest((req, res) => { | |
// you have access to standard express req and res inside function | |
const hours = (new Date().getHours() % 12) + 1; // london is UTC + 1hr; | |
res.status(200).send(`<!doctype html> | |
<head> | |
<title>Time</title> |
NewerOlder