Skip to content

Instantly share code, notes, and snippets.

View kweiberth's full-sized avatar

Kurt Weiberth kweiberth

View GitHub Profile
<style>.songlink-embed-container { position: relative; padding-bottom: calc(56.25% + 88); height: 0; overflow: hidden; max-width: 100%; } .songlink-embed-container iframe, .songlink-embed-container object, .songlink-embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style>
<div class='songlink-embed-container'>
<iframe src="https://song.link/embed?url=https://www.youtube.com/watch?v=dYEs7t7FZSc" frameborder="0" allowtransparency allowfullscreen></iframe>
</div>

What I mean by "changing" props is really more like calculating stuff using the props. Props are just data that happen to come from a parent component. In the render() function, you can calculate stuff form the props, create a new variable, and if that variable is then passed down to a child component, it's a prop when your point of view is inside the child component.

So let's imagine you work over here at PayPal. We might want to query the server for a user's credit cards and funding options. So we might have a prop called wallet. Our propTypes validation will look something like this:

propTypes: {
  wallet: React.PropTypes.shape({
    visaNumber: React.PropTypes.string.isRequired,
    mastercardNumber: React.PropTypes.string.isRequired,
 paypalBalance: React.PropTypes.string.isRequired,

Docker

GAMEPLAN:

  1. basic overview
  2. demo basic commands
  3. demo basic app
  4. demo real (hello) world app

Questions, questions, questions please

# NOTE: This is the .zshrc used before macOS supported zsh as
# default. Thus, none of the oh-my-zsh below is really needed.
# See this gist for latest: https://gist.github.com/kweiberth/24472ae38a79cbd9e75f7c0ee1b74bef
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/kurt/.oh-my-zsh"
@kweiberth
kweiberth / .bash_profile
Created August 31, 2015 05:41
bash profile settings for setting up a workstation computer
alias showFiles="defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app"
alias hideFiles="defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app"
alias prof="subl ~/.bashrc"
alias reprof=". ~/.bashrc"
alias code="cd ~/code/"
alias desktop="cd ~/Desktop"
alias downloads="cd ~Downloads"

First, head over to the code sandbox for eloquent javascript. Here, you can select chapter 5: higher-order functions and then you can play around with the code. Basically, this loads the objects and functions for the chapter. It's cool to work in this "sandbox", but I find it easier to work locally on your computer. It will also help us learn how to do this stuff in a more real-world environment.

On the sandbox page you can download a .zip file with the code for chapter 5. Download it and unzip it. Now in this folder we have the following files:

05_higher_order
├── code
│   ├── ancestry.js
│   ├── chapter
│   │   └── 05_higher_order.js