(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.
| var request = require("request"), | |
| cheerio = require("cheerio"), | |
| url = "https://www.google.com/search?q=data+mining", | |
| corpus = {}, | |
| totalResults = 0, | |
| resultsDownloaded = 0; | |
| function callback () { | |
| resultsDownloaded++; |
| /* | |
| * I saw this thread: http://stackoverflow.com/questions/840781/easiest-way-to-find-duplicate-values-in-a-javascript-array | |
| * The solutions from gist:1305056 were elegant, but wrong. So here's mine: | |
| */ | |
| Array.prototype.unique = function(test) { | |
| /* returns a new, sorted Array without duplicates */ | |
| if (!Array.isArray(this)) | |
| throw new TypeError("Array.prototype.unique must be called on an Array"); | |
| return this.slice(0).sort().filter( typeof test == "function" | |
| ? function(v, i, a) { return !i || !test(v, a[i-1]); } |
| /* This is intentionally blank just and exists to secure a decent gist name */ |
Jest Mock Any Property on Window Utility - with automatic cleanup.
| import React from 'react'; | |
| import styled from 'styled-components'; | |
| const Button = styled.a` | |
| line-height: 2; | |
| height: 5rem; | |
| text-decoration: none; | |
| display:inline-flex; | |
| color: #FFFFFF; | |
| background-color: #FF813F; |