{
"entry": [
{
"id": "1944407515840583",
"time": 1512469177548,
"messaging": [
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
/** | |
* create by Zap Lin | |
* this is a magic function for collecting form data and convert it to object | |
* | |
* ref: https://developer.mozilla.org/zh-TW/docs/Web/API/FormData/FormData | |
*/ | |
/** | |
* collecting data from <form> element and convert to Object (JSON) |
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
create function fn_split(@str nvarchar(max),@separator as nvarchar(max)) | |
returns @splits table(segment nvarchar(max)) | |
as | |
begin | |
declare @anchor int=CHARINDEX(@separator,@str),@gram int=len(@separator) | |
while @anchor>0 and @gram<=len(@str) | |
begin | |
insert into @splits values(SUBSTRING(@str, 1, @anchor-1)) | |
set @str=SUBSTRING(@str,@anchor+@gram,len(@str)-@anchor+@gram+1) | |
set @anchor=CHARINDEX(@separator,@str) |
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
class Frame extends Component { | |
componentDidMount() { | |
this.iframeHead = this.node.contentDocument.head | |
this.iframeRoot = this.node.contentDocument.body | |
this.forceUpdate() | |
} | |
render() { | |
const { children, head, ...rest } = this.props | |
return ( |
本文以 .NET 專案開發人員的的角度撰寫
DevOps 是現在非常主流的開發方式,目的只有一個:開發、測試與佈署自動化一氣呵成,減少開發過程中繁複的工作。
假設今天要測試一個功能,我們在本機將程式碼改好, 測試無誤後,還要手動放到遠端測試機器上,在遠端測試機器上也測試無誤後,才算完成。但如果在遠端測試機有錯誤,勢必又得回本機進行修正,修正完再佈署一次...,即使只改一行 code,也必須如此...,無形中便增加了非常多的開發成本...
其中最關鍵的部分是:自動化持續整合(CI)和持續部署(CD)。而 Microsoft Team Foundation Server 2017 已經有非常完整的 solution for DevOps,.NET 開發人員可以使用其提供的介面,方便的設定符合自己專案的 CI/CD pipeline,無需使用其他第三方工具。
回歸本質,這類的工具雖然提供了十分方便的功能,但我們還是能透過最原始的指令,來兜出仿 CI/CD 效果的功能,以下將逐步介紹。
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
const exec = require('child_process').exec | |
exec('py main.py', (error, stdout, stderr) => { | |
if(error) | |
console.log('print',stderr) | |
else | |
console.log('print',stdout) | |
}) |
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 d = require('./data'); | |
module.exports = { | |
add: function(item){ | |
d.data.push(item); | |
} | |
} |
NewerOlder