(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.
| app.directive('infiniteScroll', [ | |
| '$rootScope', '$window', '$timeout', function($rootScope, $window, $timeout) { | |
| return { | |
| link: function(scope, elem, attrs) { | |
| var checkWhenEnabled, handler, scrollDistance, scrollEnabled; | |
| $window = angular.element($window); | |
| elem.css('overflow-y', 'scroll'); | |
| elem.css('overflow-x', 'hidden'); | |
| elem.css('height', 'inherit'); | |
| scrollDistance = 0; |
(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.
| /** @jsx React.DOM */ | |
| var Graphic = React.createClass({ | |
| componentDidMount: function() { | |
| var context = this.getDOMNode().getContext('2d'); | |
| this.paint(context); | |
| }, | |
| componentDidUpdate: function() { |
In React's terminology, there are five core types that are important to distinguish:
React Elements
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).
A curated list of amazingly awesome Electronic and Hardware platform #WoT #IoT #M2M
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
| package com.company.project.controllers; | |
| import com.company.project.model.api.ErrorJson; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.beans.factory.annotation.Value; | |
| import org.springframework.boot.autoconfigure.web.ErrorAttributes; | |
| import org.springframework.boot.autoconfigure.web.ErrorController; | |
| import org.springframework.web.bind.annotation.RequestMapping; | |
| import org.springframework.web.bind.annotation.RestController; | |
| import org.springframework.web.context.request.RequestAttributes; |
| // Exercise 1 | |
| //============== | |
| // Refactor to remove all arguments by partially applying the function | |
| var words = function(str) { | |
| return _.split(' ', str); | |
| }; | |
| var match = R.curry(function(what, x) { | |
| return x.match(what); |