Functional programming gets a bad wrap about being too hard for mere mortals to comprehend. This is nonsense. The concepts are actually quite simple to grasp.
The jargon is the hardest part. A lot of that vocabulary comes from a specialized field of mathematical study called category theory (with a liberal sprinkling of type theory and abstract algebra). This sounds a lot scarier than it is. You can do this!
All examples using ES6 syntax. wrap (foo) => bar means:
function wrap (foo) {| /** | |
| * Actively wait for an element present and displayed up to specTimeoutMs | |
| * ignoring useless webdriver errors like StaleElementError. | |
| * | |
| * Usage: | |
| * Add `require('./waitReady.js');` in your onPrepare block or file. | |
| * | |
| * @example | |
| * expect($('.some-html-class').waitReady()).toBeTruthy(); | |
| */ |
(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.
| # Compiled source # | |
| ################### | |
| *.com | |
| *.class | |
| *.dll | |
| *.exe | |
| *.o | |
| *.so | |
| # Packages # |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');Those suck for maintenance and they're ugly.
| static NSString *cacheDatabaseName = @"ApplicationCache.db"; | |
| static NSString *cacheGroupTable = @"CacheGroups"; | |
| static NSString *cacheGroupTableManifestURLColums = @"manifestURL"; | |
| static NSString *cacheTable = @"Caches"; | |
| static NSString *cacheTableCacheGroupId = @"cacheGroup"; | |
| /** | |
| Clears the cached resources associated to a cache group. | |
| @param manifestURLs An array of `NSString` containing the URLs of the cache manifests for which you want to clear the resources. |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |