重點:針對履歷客製化試題、函式庫工具原理解析。
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Center middle image and maintain aspect ratio</title> | |
<style id="jsbin-css"> | |
html, body { | |
height: 100%; | |
} |
This file contains 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'; | |
function resize(str, size) { | |
if (typeof size === 'undefined') return str; | |
return str.replace(/(https?):\/\/picture-original.cdn.com\/([^.]*).(jpe?g|png|gif)/ig, function (match, protocol, key, ext) { | |
return protocol + '://picture-thumb.cdn.com/' + key + '-' + size + '.' + ext; | |
}); | |
} | |
console.assert(resize('https://picture-original.cdn.com/page-localhost-2017710.jpg', 300) === 'https://picture-thumb.cdn.com/page-localhost-2017710-300.jpg', { msg: 'test1 failed' }); |
音視頻技術參考
https://github.com/gwuhaolin/blog/issues/5
https://read01.com/zD2OdO.html
https://github.com/ossrs/srs
https://imququ.com/post/html5-live-player-1.html
http://blog.ucloud.cn/?p=694
Before reading this article I have no idea about JWT authetication and think there's no difference bewteen them, after that I was wrong, really needs to pay more attention on security issue.
- HttpOnly flag: make sure cookies not be manipulated by javascript (immune to XSS)
- Secure flag: guarantee the cookies is only sent over HTTPS
- Prevent CSRF: check
Referer
andOrigin
from API
This file contains 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
HOST_ZONE_ID= | |
ACTION= | |
DNS_NAME= | |
# Add A record for s3 website hosting using custom domain | |
# Ref: http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html | |
aws route53 change-resource-record-sets --hosted-zone-id $HOST_ZONE_ID --change-batch "{ | |
\"Changes\": [{ | |
\"Action\": \"$ACTION\", | |
\"ResourceRecordSet\": { |
This file contains 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 factorial(m) { | |
return m <= 1 ? m : m * factorial(m - 1); | |
} | |
function fibonacci(n) { | |
return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); | |
} | |
function prime(p) { | |
return p >= 1 ? isPrime(p) ? prime(--p).concat([p + 1]) : prime(--p) : []; |