-
https://icons.duckduckgo.com/ip2/{hostname}.ico
-
https://www.google.com/s2/favicons?domain_url={hostname}
-
https://favicon.yandex.net/favicon/{hostname1}/{hostname2}/
-
https://f1.allesedv.com/16/{hostname}
http://grab-favicons.herokuapp.com/api/v1/grab-favicons/?url={hostname}
https://besticon-demo.herokuapp.com/icon?url={hostname}&size=80..120..200
http://favicongrabber.com/service-api-reference
Recently when refactoring a Vue 1.0 application, I utilized ES6 arrow functions to clean up the code and make things a bit more consistent before updating to Vue 2.0. Along the way I made a few mistakes and wanted to share the lessons I learned as well as offer a few conventions that I will be using in my Vue applications moving forward.
The best way to explain this is with an example so lets start there. I'm going to throw a rather large block of code at you here, but stick with me and we will move through it a piece at a time.
<script>
// require vue-resource...
new Vue({
// NOTE requires lodash v3.4.0+ (for _.sum) and Node 4.0+ (for arrow function) | |
var _ = require('lodash'); | |
function σ (array) { | |
var avg = _.sum(array) / array.length; | |
return Math.sqrt(_.sum(_.map(array, (i) => Math.pow((i - avg), 2))) / array.length); | |
}; |
I've developed a useful feature in KeystoneJS that lets you populate a relationship from either side, while only storing the data on one side, and am looking for feedback on whether it is something that could / should be brought back into mongoose itself. (It might be possible to add as a separate package but I suspect there'd be too much rewriting of mongoose internals for that to be a good idea).
I've added this as an issue in mongoose for consideration: #1888 but am leaving this gist in place because the examples are easier to read.
I've used Posts and Categories as a basic, contrived example to demonstrate what I'm talking about here; in reality you'd rarely load all the posts for a category but there are other real world cases where it's less unreasonable you'd want to do this, and Posts + Categories is an easy way to demo it.
The built-in population feature is really useful; not just for
var rfc822Date = moment(yourDate).format('ddd, DD MMM YYYY HH:mm:ss ZZ') |