Skip to content

Instantly share code, notes, and snippets.

We are describing some scenarios that involve tapping into the component lifecycle:

  • You want to make a request to fetch the user's orders when you are ready to display the orders table (a component).
  • You want to detect when a search field has changed to trigger a new search request.
  • You are filtering a set of cities in the United States based on search in your render method. For performance reasons, you only want to render when the search field has changed.
  • You want to display a new flashcard on the screen but you want to use a CSS transition to make what's currently there fade out.
  • You need to initialize a UI component from a third party (think Materialize, chart.js, d3) once it is loaded.
@MrJadaml
MrJadaml / mac-maker.md
Last active November 20, 2016 23:06
Initial notes for the items that will be rolled into a development environment build script.

Packages/bins

  • npm
  • node.js
  • ohmyzsh
  • Brew
  • awscli
  • httpie
  • postgresql
  • tmux
@MrJadaml
MrJadaml / all-props.json
Last active December 16, 2016 00:15
Organization of USDA plants data. WIP
[
[
"usdaplants_table",
"characteristics_20160713_table",
"usda_plants_20160713_table"
], [
"id",
"betydb.species.id",
"Genus",
"Species",
@MrJadaml
MrJadaml / Address.jsx
Last active February 8, 2017 21:25
styled-components module structure
import React from 'react';
import { Input, Select, Option, Label } from '../assets/styled-components/forms.js';
class Address extends React.Component {
render() {
return (
<section>
<h3>Address Component</h3>
<Label fullwidth >Street 1:
<Input type="text" fullwidth />
@MrJadaml
MrJadaml / steps.md
Created February 21, 2017 16:36
Hello Vim

Steps

Part 1: Setup

  • create new dir basic-vim and cd into it: take basic-vim
  • create new file touch foo.js
  • initilize a git repo git init
  • add some code to the foo file
const hello = (name) => {
  const greet = `Well hello there, ${name}`;
@MrJadaml
MrJadaml / react-router-v4.md
Last active February 26, 2017 18:58
React Router has undergone a rewrite for version 4. This is a short walkthrough on getting going with v4.

Objectives

  • What is React Router v4
  • Explain what the BrowserRouter component is for
  • Explain what the Link component is for
  • Explain what Router and Miss components are for

React Router v4

HTTP and Node.js

Objectives

By the end of this lesson, you should be able to...

  • Explain what an HTTP server is
  • Explain why an HTTP server is useful
  • Explain what an HTTP request is
  • Explain what an HTTP response is
  • Create a Node.js HTTP server with the http module
// ----------------------------------------------------------------------------
//
//
// ___ ___ ___
// / /\ ___ / /\ /__/\
// / /::\ / /\ / /:/_ | |::\
// / /:/\:\ / /:/ / /:/ /\ | |:|:\
// / /:/~/:/ / /:/ / /:/ /:/ __|__|:|\:\
// /__/:/ /:/___ / /::\ /__/:/ /:/ /__/::::| \:\
// \ \:\/:::::/ /__/:/\:\ \ \:\/:/ \ \:\~~\__\/

Arduino code for photocell sensor.

#define CDS_INPUT 0 

void setup() {
  Serial.begin(9600);
}
@MrJadaml
MrJadaml / ideas.md
Last active April 28, 2017 22:24
resin.io hackathon ideas.

BathroomBot

  • humidy sensor that turns on fan when you shower
  • motion sensor that triggers different services based on time of day
    • Morning:
      • shows weather icons/data while you get ready.
      • turns on morning soundtrack.
      • sends out signal to other "morning" services to start up.
    • Night:
  • turns on sense_hat LEDs to red to light up bathroom without blowing out your eyes.