- Injection
- Broken Authentication and Session Management
- XSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Auther: s25g5d4 @ https://github.com/s25g5d4 | |
Usage: | |
用法很簡單,只要 var q = new Queue(limit, timeout, delay) | |
第一個參數是這個 queue 最大同時併發量 | |
第二個參數是任務執行的 timeout | |
當某個任務執行超過 timeout 時間後會自動被 reject | |
第三個參數是任務完成後強制延後下一個任務執行的時間 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
@版本 2.0.0
譯注:此翻譯版,主要給不能流利的讀英文的人看,相關專有名詞還是保留原文。翻譯不好地方請協助pull request.
此repository包含了一些前端開發的面試問題,來審查一個有潛力的面試者。這並不是建議你對同一個面試者問上所有的問 (那會花費好幾小時)。從列表中挑幾個題目,應該就夠幫助你審查面試者是否擁有你需要的技能。
Rebecca Murphey 的 Baseline For Front-End Developers 也是一篇很棒且值得讀的文章在你開始面試之前。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
class DepClass { | |
constructor (arg) { | |
console.log(arg); | |
} | |
say (word) { | |
console.log(word); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |