Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.
video::webkit-media-controls-timeline {
background-color: lime;
}
video /deep/ input[type=range] {| #!/bin/sh | |
| remove_dangling() { | |
| echo "Removing dangling images ..." | |
| docker rmi $(docker images -f dangling=true -q) | |
| } | |
| remove_stopped_containers() { | |
| echo "Removing stopped containers ..." | |
| docker rm $(docker ps -qa) |
(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.
| // polyfill window.getMatchedCSSRules() in FireFox 6+ | |
| if ( typeof window.getMatchedCSSRules !== 'function' ) { | |
| var ELEMENT_RE = /[\w-]+/g, | |
| ID_RE = /#[\w-]+/g, | |
| CLASS_RE = /\.[\w-]+/g, | |
| ATTR_RE = /\[[^\]]+\]/g, | |
| // :not() pseudo-class does not add to specificity, but its content does as if it was outside it | |
| PSEUDO_CLASSES_RE = /\:(?!not)[\w-]+(\(.*\))?/g, | |
| PSEUDO_ELEMENTS_RE = /\:\:?(after|before|first-letter|first-line|selection)/g; | |
| // convert an array-like object to array |
| // jonathantneal's polyfill for matchesSelector | |
| if (this.Element) function(ElementPrototype) { | |
| ElementPrototype.matches = ElementPrototype.matchesSelector = | |
| ElementPrototype.matchesSelector || | |
| ElementPrototype.webkitMatchesSelector || | |
| ElementPrototype.mozMatchesSelector || | |
| ElementPrototype.msMatchesSelector || | |
| ElementPrototype.oMatchesSelector || | |
| function (selector) { | |
| var nodes = (this.parentNode || this.document).querySelectorAll(selector), i = -1; |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.| class Hash | |
| def dig(*path) | |
| path.inject(self) do |location, key| | |
| location.is_a?(Hash) ? location[key] : nil | |
| end | |
| end | |
| end |
| # Matches patterns such as: | |
| # https://www.facebook.com/my_page_id => my_page_id | |
| # http://www.facebook.com/my_page_id => my_page_id | |
| # http://www.facebook.com/#!/my_page_id => my_page_id | |
| # http://www.facebook.com/pages/Paris-France/Vanity-Url/123456?v=app_555 => 123456 | |
| # http://www.facebook.com/pages/Vanity-Url/45678 => 45678 | |
| # http://www.facebook.com/#!/page_with_1_number => page_with_1_number | |
| # http://www.facebook.com/bounce_page#!/pages/Vanity-Url/45678 => 45678 | |
| # http://www.facebook.com/bounce_page#!/my_page_id?v=app_166292090072334 => my_page_id | |
| # http://www.facebook.com/my.page.is.great => my.page.is.great |
| // | |
| // Regular Expression for URL validation | |
| // | |
| // Author: Diego Perini | |
| // Created: 2010/12/05 | |
| // Updated: 2018/09/12 | |
| // License: MIT | |
| // | |
| // Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
| // |