CoffeeScript 1.7 is shaping up to be a pretty kick-ass release with significant improvements. Here are the ones I'm most excited about, in order of my own excitement.
Years of being wished for, finally granted!
CoffeeScript 1.7 is shaping up to be a pretty kick-ass release with significant improvements. Here are the ones I'm most excited about, in order of my own excitement.
Years of being wished for, finally granted!
cloneNode and createElement to be fast (via Aysegul Yonet). 🐑| // [B](f: (A) ⇒ [B]): [B] ; Although the types in the arrays aren't strict (: | |
| Array.prototype.flatMap = function(lambda) { | |
| return Array.prototype.concat.apply([], this.map(lambda)); | |
| }; |
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| # Python script to find the largest files in a git repository. | |
| # The general method is based on the script in this blog post: | |
| # http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/ | |
| # | |
| # The above script worked for me, but was very slow on my 11GB repository. This version has a bunch | |
| # of changes to speed things up to a more reasonable time. It takes less than a minute on repos with 250K objects. | |
| # |
(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.
| import React from 'react'; | |
| import shallowEqual from 'react/lib/shallowEqual'; | |
| class PureRenderComponent extends React.Component { | |
| shouldComponentUpdate(nextProps, nextState) { | |
| return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState); | |
| } | |
| } |
| # NewFileAtCurrentFolder | |
| import sublime_plugin | |
| import os.path | |
| class NewFileListener(sublime_plugin.EventListener): | |
| def on_new_async(self, view): | |
| if not view.window().active_view(): | |
| print("NF: no view") | |
| return |
The standard code style linter is a great tool by Feross - check it out!
Remove trailing semicolons:
find . -path ./node_modules -prune -o -type f -name '*.js' -exec sed -i '' -e 's/;$//' {} \;
Ensure space between function and opening bracket:
| console.log('Loading function'); | |
| var doc = require('dynamodb-doc'); | |
| var dynamo = new doc.DynamoDB(); | |
| /** | |
| * Provide an event that contains the following keys: | |
| * | |
| * - operation: one of the operations in the switch statement below | |
| * - tableName: required for operations that interact with DynamoDB |
Picking the right architecture = Picking the right battles + Managing trade-offs