多巧啊, 人家姓 Curry 名 Haskell, 难怪 Haskell 语言会自动柯里化, 呵呵. 但是不奇怪吗, 为什么要柯里化呢. 为什么如此重要导致 Haskell 会默认自动柯里化所有函数, 不就是返回一个部分配置好的函数吗.
我们来看一个 Haskell 的代码.
max 3 4
(max 3) 4
function whichTransitionEvent(){ | |
var t; | |
var el = document.createElement('fakeelement'); | |
var transitions = { | |
'transition':'transitionend', | |
'MSTransition':'msTransitionEnd', | |
'MozTransition':'transitionend', | |
'WebkitTransition':'webkitTransitionEnd' | |
} |
// ES6 for loops | |
// ============= | |
// Things in ES6 can be "iterable". Arrays are iterable by default. | |
var fruits = ['Apple', 'Banana', 'Grape']; | |
for (var fruit of fruits) | |
console.log('Fruit: ' + fruit); |
function getFnName(fn) { | |
var f = typeof fn == 'function'; | |
var s = f && ((fn.name && ['', fn.name]) || fn.toString().match(/function ([^\(]+)/)); | |
return (!f && 'not a function') || (s && s[1] || 'anonymous'); | |
} | |
console.log(getFnName(String)); // 'String' | |
console.log(getFnName(function test(){})); // 'test' | |
console.log(getFnName(function (){})); // 'anonymous' |
'use strict'; | |
class DepClass { | |
constructor (arg) { | |
console.log(arg); | |
} | |
say (word) { | |
console.log(word); | |
} |
@版本 2.0.0
譯注:此翻譯版,主要給不能流利的讀英文的人看,相關專有名詞還是保留原文。翻譯不好地方請協助pull request.
此repository包含了一些前端開發的面試問題,來審查一個有潛力的面試者。這並不是建議你對同一個面試者問上所有的問 (那會花費好幾小時)。從列表中挑幾個題目,應該就夠幫助你審查面試者是否擁有你需要的技能。
Rebecca Murphey 的 Baseline For Front-End Developers 也是一篇很棒且值得讀的文章在你開始面試之前。
# Assuming that you have followed all the instructions from https://github.com/rumblelabs/asset_sync | |
# Put this in your deployment script | |
# Choose any environment here the important part is that your environment is using the same bucket for all environments | |
# than you only need to precompile assets once | |
RAILS_ENV=staging bundle exec rake assets:precompile | |
# You need to set git credentials otherwise it won't be able to commit | |
git config --global user.email "[email protected]" | |
git config --global user.name "Codeship Server" | |
# Add your manifest file so that rails can find digested version of files |
/* | |
Openshift uses haproxy (haproxy.org) as a front proxy to route request to instances of the app. | |
This proxy does the job of unwrapping https and sets the 'x-forwarded-proto' header. | |
Because of this, the Node.JS app never sees the actual protocol of the request, unless it checks the presence of this header. | |
I modified the code written by goloroden (https://github.com/goloroden/node-force-domain) to check this header instead of ports. | |
This gist does exactly what his code does, except checks for actual protocol instead of relying on the port for the protocol. | |
*/ | |
var rewrite = function (route, options) { | |
options = _.defaults({ |
var LoopbackBootPlugin = require('loopback-webpack-plugin'); | |
var fs = require('fs'); | |
var path = require('path'); | |
var webpack = require('webpack'); | |
var config = { | |
debug: true, | |
devtool: 'source-map', |