Skip to content

Instantly share code, notes, and snippets.

View browniefed's full-sized avatar
🎧
Building

Jason Brown browniefed

🎧
Building
View GitHub Profile

Test

{
"presets": ["next/babel", "@emotion/babel-preset-css-prop"],
"plugins": [
[
"prismjs",
{
"languages": [
"javascript",
"css",
"markup",
module.exports = {
overwrite: true,
generates: {
"./data/index.tsx": {
schema: [
{
"http://localhost:8081/v1/graphql": {
headers: {
"x-hasura-role": "anonymous"
}

Consuming Package

Setup this as an .npmrc in a consumer

always-auth=true
@github-org:registry=https://npm.pkg.github.com/github-org/
_authToken=TOKEN
//npm.pkg.github.com/:_authToken=TOKEN
@browniefed
browniefed / gist:5610144
Last active October 10, 2019 22:07
An explanation of TriMet vehicle tracking, and how PDXLiveBus leverages Node.JS/Firebase to create a pseudo real time map.

#PDXLiveBus

This is a quick tutorial. It's a 2 parter, the first part explaining the concept, how I got the data, and other misc things. The second part is going to be technical. I'll walk you through launching your own PDXLiveBus, and then building it from scratch. Hopefully this can help you implemnet one for your own city.

#The Concept The concept was actually built from SFLiveBus and I just happened to see it and said I could do that. It also helped that I took TriMet and was a little frustrated in that the bus was always late and all I ever wanted to know was where it was at.

#The Vehicles

import { StyleSheet, View, Text, ActivityIndicator } from "react-native";
import Sizer from "react-native-size";
import {
VictoryChart,
VictoryLine,
VictoryTheme,
VictoryAxis,
VictoryContainer,
VictoryCursorContainer,
Line,
import React from "react";
import ReactModal from "react-modal";
import styled from "react-emotion";
export interface ModalProps {
open: boolean;
contentLabel?: string;
onClose: Function;
}
import React from "react";
import { StyleSheet, Text, View, TouchableOpacity } from "react-native";
import { StackNavigator } from "react-navigation";
const Home = ({ navigation }) => {
return (
<View style={styles.container}>
<TouchableOpacity onPress={() => navigation.push("OtherStack")}>
// push will only go to "OtherStack" but because we are now inside of "OtherStack" and it's new nested StackNavigator. There is no "OtherStack" just "Meow" and "Blue".
// If we do "navigate" instead it would keep navigating forever
import React from "react";
import { StyleSheet, Text, View, TouchableOpacity } from "react-native";
import { StackNavigator, DrawerNavigator, NavigationActions } from "react-navigation";
const ScreenFirst = (props) => (
<View>
<TouchableOpacity onPress={() => props.screenProps.onOpen()}>
<Text>Pop Up Something Cool</Text>
</TouchableOpacity>
import React from "react";
import { render } from "react-dom";
import { BrowserRouter, Switch, Route } from "react-router-dom";
import RenderTo from "./render_to";
import Header from "./components/header";
import Nav from "./components/nav";
import Home from "./pages/home";
import AccountsReview from "./pages/accounts_review";