--
Should go in lowercase
bug - Code changes linked to a known issue.
feature - New feature.
hotfix - Quick fixes to the codebase.
junk - Experiments (will never be merged).
rm -fr ~/.expo/starter-app-cache |
module.exports = function solve(maze, miner, exit) { | |
let directionsArray = ["up", "right", "down", "left"]; | |
const movements = { | |
left: { x: -1, y: 0 }, | |
right: { x: 1, y: 0 }, | |
up: { x: 0, y: -1 }, | |
down: { x: 0, y: 1 } | |
}; | |
const xNum = maze.length; |
React Native Cheatsheet | |
+------------------------------+-----------------------------------------+--------------------------------------------------+ | |
| | React | React Native | | |
+------------------------------+-----------------------------------------+--------------------------------------------------+ | |
| CSS | inline + css | just inline | | |
+------------------------------+-----------------------------------------+--------------------------------------------------+ | |
| HTML Containers | <div>,<section>, etc | <View/> | | |
+------------------------------+-----------------------------------------+--------------------------------------------------+ | |
| HTML Text | <p>,<h1>,etc | <Text/> + style |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Document</title> | |
</head> | |
<body> | |
<h1>Contacts</h1> | |
<div id="contact-container"></div> |
import React, { useState, useEffect } from "react"; | |
import { io } from "socket.io-client"; | |
const socket = io("http://localhost:5000/"); | |
function App() { | |
const [messageList, setMessageList] = useState([]); | |
const [nickName, setNickName] = useState(""); | |
const [newMessageText, setNewMessageText] = useState(""); | |
const [number, setNumber] = useState(); |
const n = 6; | |
const votes = ["red", "yellow", "blue", "red", "yellow", "red"]; | |
function counter(n, votes) { | |
let histogram = {}; //https://en.wikipedia.org/wiki/Histogram | |
votes.forEach((vote) => { | |
if (!histogram[vote]) histogram[vote] = 0; | |
histogram[vote]++; | |
}); |
import json from "./data.json"; | |
import { useState } from "react"; | |
function App() { | |
const [data, setData] = useState(json); | |
const upvotePost = (postId) => { | |
const indexToModify = data.post.findIndex((post) => { | |
return post.id === postId; | |
}); |
import React from 'react'; | |
import './App.css'; | |
function App() { | |
return ( | |
<div className="App"> | |
<GreetingComponent /> | |
</div> | |
); |
const express = require('express') | |
const app = express() | |
const { Client } = require('pg') | |
require('dotenv').config() | |
app.get('/test', async (req, res) => { | |
let connectionString; | |