(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.
function numberPairs(n, ar) { | |
if (n !== ar.length) { | |
console.error('Invalid array length'); | |
} | |
const obj = {}; | |
const pairs = []; | |
const pairsLength = 0; | |
do { |
const myarr = [1,2,[3]]; | |
function flatten(arr) { | |
if (Array.isArray(arr)) { | |
return arr.reduce((prev, next) => { | |
return prev.concat(flatten(next)); | |
}, []); | |
} else { | |
return arr; | |
} |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script> | |
<script> | |
var googletag = googletag || {}; | |
googletag.cmd = googletag.cmd || []; | |
</script> |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script> | |
<script> | |
var googletag = googletag || {}; | |
googletag.cmd = googletag.cmd || []; | |
</script> |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script> | |
<script> | |
var googletag = googletag || {}; | |
googletag.cmd = googletag.cmd || []; | |
</script> |
(function ellipsis(str, charLimit) { | |
var result = []; | |
var letters = 0; | |
str.split(' ').forEach(function(word, index) { | |
if (letters < charLimit) {result.push(word)} | |
letters += word.length; | |
}); | |
console.log(result.join(' ') + ' ...'); | |
})("Hero congressman calls out conservatives on racist abortion restrictions", 40); |
import { combineReducers } from 'redux'; | |
import users from './reducers/users'; | |
import posts from './reducers/posts'; | |
export default function createReducer(asyncReducers) { | |
return combineReducers({ | |
users, | |
posts, | |
...asyncReducers | |
}); |
/** | |
* External dependencies | |
*/ | |
import React, { Component, PropTypes } from 'react'; | |
import { Link } from 'react-router'; | |
import { bindActionCreators } from 'redux'; | |
import { connect } from 'react-redux'; | |
import classNames from 'classnames'; | |
/** |
(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.
# based on http://git.io/hpl2Gw | |
linters: | |
PropertySortOrder: | |
order: | |
- position | |
- top | |
- right | |
- bottom | |
- left |