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
## Ignore Visual Studio temporary files, build results, and | |
## files generated by popular Visual Studio add-ons. | |
# User-specific files | |
*.suo | |
*.user | |
*.userosscache | |
*.sln.docstates |
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
# 建立資料夾 | |
mkdir git-branch-demo | |
cd git-branch-demo | |
start . | |
# 建立版本庫 | |
git init | |
# 新增檔案 a.txt 並提交。 | |
echo 'a.txt first commit' > a.txt |
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
# 建立資料夾 | |
mkdir git-reset-demo | |
cd git-reset-demo | |
# 建立版本庫 | |
git init | |
# 新增檔案 a.txt 並提交。 | |
echo 'a.txt first commit' > a.txt | |
git add . |
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 lang="zh-Hant-TW"> | |
<head id="Head1" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#"> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>快評》陳時中玻璃心 - 短評 - 言論</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
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
```sql | |
SELECT name AS [Database Name], | |
recovery_model_desc AS [Recovery Model] FROM sys.databases | |
GO | |
``` | |
 |
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
//1. 正常 情況 | |
var people = [ | |
{name: 'Anna', score: 100, subject: 'English'}, | |
{name: 'Anna', score: 90, subject: 'Math'}, | |
{name: 'Anna', score: 96, subject: 'Chinese' }, | |
{name: 'Jerry', score: 80, subject: 'English'}, | |
{name: 'Jerry', score: 100, subject: 'Math'}, | |
{name: 'Jerry', score: 90, subject: 'Chinese' }, | |
]; | |
var source = Rx.Observable |
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
// Operators - withLatestFrom | |
var main = Rx.Observable.from([1,2,3,4,5]).zip(Rx.Observable.interval(500), (x, y) => x); | |
var some = Rx.Observable.from([0,1,0,0,0,1]).zip(Rx.Observable.interval(300), (x, y) => x); | |
var example = main.withLatestFrom(some, (x, y) => { | |
return y === 1 ? x*10 : x; | |
}); | |
example.subscribe({ | |
next: (value) => { console.log(value); }, |
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
// Operators - zip | |
var source = Rx.Observable.interval(500).take(3); | |
var newest = Rx.Observable.interval(300).take(6); | |
var example = source.zip(newest, (x, y) => x + y); | |
example.subscribe({ | |
next: (value) => { console.log(value); }, | |
error: (err) => { console.log('Error: ' + err); }, | |
complete: () => { console.log('complete'); } |
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
// Operators - combineLatest | |
/* | |
同時執行多個 observable 實例, | |
且湊齊所有的 next 才會執行 Callack Function | |
每湊齊一次,執行一次 Callack Function | |
其中一個 observable 只要一有值,就會保留(延續),直到被自己覆蓋。 | |
適合用在多 observable,只會變動其中一個 observable,但又要湊齊變數。 | |
*/ | |
var source = Rx.Observable.interval(500).take(3); |
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
//Creation Operator - from 輸入陣列 or 字串 or Promise 物件 | |
var arr = ['Jerry', 'Anna', 2016, 2017, '30 days'] | |
var source = Rx.Observable.from(arr); | |
source.subscribe({ | |
next: function(value) { | |
console.log(value) | |
}, | |
complete: function() { |