Skip to content

Instantly share code, notes, and snippets.

View bbstilson's full-sized avatar
🕺

Brandon Stilson bbstilson

🕺
View GitHub Profile

Things to look for when reviewing a React PR

Table of Contents

PropTypes

Be as specific as possible

@bbstilson
bbstilson / index.html
Created March 16, 2018 21:02
Encrypted homework
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Encrypt</title>
</head>
<body>
<div>
<p>Text to encrypt:</p>
<input id="text" type="text" placeholder="Plain text here" />
@bbstilson
bbstilson / hw.js
Created March 16, 2018 20:54
Encrypted homework
const express = require('express');
const app = express();
const crypto = require('crypto');
const supportedAlgos = new Set(['SHA1', 'SHA256', 'SHA512']);
app.use(express.static('./'));
app.get('/encrypt', (req, res) => {
const { algorithm, string } = req.query;
@bbstilson
bbstilson / server.js
Created March 1, 2018 03:19
Streaming a file from one node server to another
// transmitter.js
const http = require('http');
const fs = require('fs');
const requestOpts = {
hostname: 'localhost',
port: 1337,
method: 'POST'
};
.fancydom-in { opacity: 0 !important; animation: fadeIn 0.5s linear forwards; }
.fancydom-out { opacity: 1; animation: fadeOut 0.25s linear forwards; }
@keyframes fadeIn { 0% { opacity: 0; visibility: visible; }
0.1% { opacity: 0; }
100% { opacity: 1; } }
@keyframes fadeOut { 0% { opacity: 1; }
99.9% { opacity: 0; }
100% { opacity: 0; visibility: hidden; } }
(function () {
var body = document.getElementsByTagName('body')[0];
body.addEventListener('animationend', handleAnimEnd);
var path = '';
// fade in on dom load
(function (fn) {
if (document.readyState != 'loading') {
fn();
} else {
/**
* Custom PropType for checking multiple PropTypes.
*
* Returns an error if the prop does not pass one of the PropType checks.
* Sourced from: http://stackoverflow.com/a/31169012
*
* @param {mixed} any valid React PropType (element|string|arrayOf|shape|...)
*
* @returns {error} returns an error if all fail
*/