(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.
(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.
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; } | |
body > *:first-child { |
I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
/* | |
* twitter-entities.js | |
* This function converts a tweet with "entity" metadata | |
* from plain text to linkified HTML. | |
* | |
* See the documentation here: http://dev.twitter.com/pages/tweet_entities | |
* Basically, add ?include_entities=true to your timeline call | |
* | |
* Copyright 2010, Wade Simmons | |
* Licensed under the MIT license |
There was a [great article][1] about how react implements it's virtual DOM. There are some really interesting ideas in there but they are deeply buried in the implementation of the React framework.
However, it's possible to implement just the virtual DOM and diff algorithm on it's own as a set of independent modules.
A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()
):
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
/* Client side, works in Chrome 55 and Firefox 52 without transpilation */ | |
//https://blogs.msdn.microsoft.com/typescript/2016/11/08/typescript-2-1-rc-better-inference-async-functions-and-more/ | |
async function fetchURLs() { | |
try { | |
// Promise.all() lets us coalesce multiple promises into a single super-promise | |
var data = await Promise.all([ | |
/* Alternatively store each in an array */ | |
// var [x, y, z] = await Promise.all([ | |
// parse results as json; fetch data response has several reader methods available: | |
//.arrayBuffer() |
<!-- Flat ComboBox --> | |
<SolidColorBrush x:Key="ComboBoxNormalBorderBrush" Color="#e3e9ef" /> | |
<SolidColorBrush x:Key="ComboBoxNormalBackgroundBrush" Color="#fff" /> | |
<SolidColorBrush x:Key="ComboBoxDisabledForegroundBrush" Color="#888" /> | |
<SolidColorBrush x:Key="ComboBoxDisabledBackgroundBrush" Color="#eee" /> | |
<SolidColorBrush x:Key="ComboBoxDisabledBorderBrush" Color="#888" /> | |
<ControlTemplate TargetType="ToggleButton" x:Key="ComboBoxToggleButtonTemplate"> | |
<Grid> | |
<Grid.ColumnDefinitions> |