Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| #!/bin/bash | |
| # A little Bash script to make a mirror of your Github repositories and keep | |
| # them up-to-date. | |
| # Why mirroring? Because I can! | |
| # Also, it will be very useful if one day a meteorite crashes into Github | |
| # servers (even if it will not happen). | |
| # https://gist.github.com/950441 |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Douglas Crockford, author of JavaScript: The Good parts, recently gave a talk called The Better Parts, where he demonstrates how he creates objects in JavaScript nowadays. He doesn't call his approach anything, but I will refer to it as Crockford Classless.
Crockford Classless is completely free of class, new, this, prototype and even Crockfords own invention Object.create.
I think it's really, really sleek, and this is what it looks like:
function dog(spec) {$ ./githubapi-get.sh $GITHUBTOKEN /users/mbohun/reposHTTP/1.1 200 OK
Server: GitHub.com
Date: Wed, 04 Mar 2015 04:30:29 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 155683
Status: 200 OK| // with static data, do filtering and sorting in the client | |
| <Autocomplete | |
| initialValue="Ma" | |
| items={getUnitedStates()} | |
| getItemValue={(item) => item.name} | |
| shouldItemRender={(item, value) => ( | |
| state.name.toLowerCase().indexOf(value.toLowerCase()) !== -1 || | |
| state.abbr.toLowerCase().indexOf(value.toLowerCase()) !== -1 | |
| )} | |
| sortItems={(a, b, value) => ( |
| module.exports = function(duration) { | |
| return function(){ | |
| return new Promise(function(resolve, reject){ | |
| setTimeout(function(){ | |
| resolve(); | |
| }, duration) | |
| }); | |
| }; | |
| }; |
Skupina je spravována pro podporu komunity http://frontendisti.cz/.
Should be work with 0.18
Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !
myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))| // A: is this pure function? | |
| function sum(a, b) { return a + b } | |
| // B: is this a pure function? | |
| const k = 2 | |
| function addK(a) { return a + k } | |
| // C: is this a pure function? | |
| function sub(a, b) { return sum(a, -b) } | |
| // D: is this a pure function? | |
| function sub(a, b, summer) { return summer(a, b) } | |
| // E: is this a pure function? |