##Chai Expect
##Language Chains
- to
- be
- been
- is
- that
- and
- have
##Chai Expect
##Language Chains
/* | |
* Observable | |
*/ | |
var xs = Rx.Observable.range(0, 3) | |
xs.subscribe(log) | |
//=> 0 | |
//=> 1 | |
//=> 2 |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
#RxJS 5 Operators By Example A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
##AutoComplete Scenario##
Capture user input to send to the service for data: http://jsfiddle.net/mattpodwysocki/uv5JU/
Throttle the data so we don't overload the server: http://jsfiddle.net/mattpodwysocki/EJqv5/
Ensure minimum number of characters: http://jsfiddle.net/mattpodwysocki/nWfH9/
Only distinct values, no repeats!: http://jsfiddle.net/mattpodwysocki/THMPk/
First class functions
When we say functions are "first class", we mean they are just like everyone else. We can treat functions like any other data type and there is nothing particularly special about them - they may be stored in arrays, passed around, assigned to variables, what have you. (dr boolean)
PointFree Functions
Pointfree style means never having to say your data. Excuse me. It means functions that never mention the data upon which they operate.
Functor
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
elem.clientLeft
, elem.clientTop
, elem.clientWidth
, elem.clientHeight
elem.getClientRects()
, elem.getBoundingClientRect()
I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log
in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.
#!/usr/bin/perl | |
# | |
# @file | |
# Converter tool, from Apache Common Log file to CSV. | |
# | |
# All code is released under the GNU General Public License. | |
# See COPYRIGHT.txt and LICENSE.txt. | |
# | |
// should be able to run in any ever green browser or nodejs version 5 and above | |
const flatten = (inputArray, accumulator) => { | |
inputArray.forEach((val) => { | |
if (Array.isArray(val)) { | |
flatten(val, accumulator); // tail recursion | |
} else { | |
accumulator.push(val); | |
} | |
}); |