- 更新
2014-11-20
- バージョン
0.0.5
- 作者
@voluntas
- URL
概要
" buffer書き換え前 | |
let s:mychangedtick = b:changedtick | |
" buffer書き換えて操作 | |
" ... | |
" 書き換え後に | |
" for tpope/vim-repeat | |
if exists('g:repeat_tick') | |
if g:repeat_tick == s:mychangedtick |
2014-11-20
0.0.5
@voluntas
概要
ok = (ok) -> console.log if ok then 'ok' else 'FAIL' | |
FnError = (message) -> | |
@name = 'FnError' | |
@message = message | |
@stack = (new Error).stack | |
FnError:: = new Error |
(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.
Copy and paste the swift code below into a playground to experiment.
This is a very close emulation of Functor and Monad typeclasses in swift. However, it is very fragile (i.e. easy to crash the compiler).
For example, instance methods of fmap
will run fine, but attempting to use a globally defined fmap
that acts on Functor
types will cause a crash. Similarly for bind
. Unfortunately this means we cannot define the nice infix operator versions of these functions.
atom.packages.requirePackages = (packages...) -> | |
new Promise (resolve, reject) -> | |
required = [] | |
promises = [] | |
failures = [] | |
remains = packages.length | |
solved = -> | |
remains-- |
This blog post series has moved here.
You might also be interested in the 2016 version.
I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.
In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.
While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.
Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio