(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
./configure \ | |
--prefix=/usr \ | |
--mandir=/usr/share/man \ | |
--infodir=/usr/share/info \ | |
--sysconfdir=/private/etc \ | |
--with-apxs2=/usr/sbin/apxs \ | |
--enable-cli \ | |
--with-config-file-path=/etc \ | |
--with-libxml-dir=/usr \ | |
--with-openssl=/usr \ |
# Colorful Bash Prompt, inspired by "Extravagant Zsh Prompt" | |
# Screenshot: http://img.gf3.ca/d54942f474256ec26a49893681c49b5a.png | |
# A big thanks to \amethyst on Freenode | |
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color | |
elif infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color | |
fi | |
if tput setaf 1 &> /dev/null; then | |
tput sgr0 |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
import React from 'react' | |
import { Loading } from '../components/loading' | |
function asyncComponent (getComponent) { | |
return class AsyncComponent extends React.Component { | |
static Component = null | |
mounted = false | |
state = { | |
Component: AsyncComponent.Component |
// @flow | |
// Flow Fundamentals For JavaScript Developers | |
/* | |
Tutorial for JavaScript Developers wanting to get started with FlowType. | |
Thorough walkthrough of all the basic features. | |
We will go through the basic features to gain a better understanding of the fundamentals. | |
You can uncomment the features one by one and work through this tutorial. |
Intended for developers interested in getting started with Flow. At the end of this introduction, you should have a solid understanding of Flow and how to apply it when building an application.
Covers all the basics needed to get started with Flow.
Covers all the basic needed to get started with Flow and ReactJS.
/** | |
* Rotates coordinate system for velocities | |
* | |
* Takes velocities and alters them as if the coordinate system they're on was rotated | |
* | |
* @param Object | velocity | The velocity of an individual particle | |
* @param Float | angle | The angle of collision between two objects in radians | |
* @return Object | The altered x and y velocities after the coordinate system has been rotated | |
*/ |
import { useRef, useState, useEffect } from 'react' | |
import ResizeObserver from 'resize-observer-polyfill' | |
export default function useMeasure() { | |
const ref = useRef() | |
const [bounds, set] = useState({ left: 0, top: 0, width: 0, height: 0 }) | |
const [ro] = useState(() => new ResizeObserver(([entry]) => set(entry.contentRect))) | |
useEffect(() => (ro.observe(ref.current), ro.disconnect), []) | |
return [{ ref }, bounds] | |
} |