"editor.minimap.enabled": true
- 在捲軸上開啟 MiniMap 功能。
"editor.minimap.renderCharacters": false
- 如果開啟 MiniMap 的話,預設會顯示實際字元 (字超小),根本看不清楚。
- 將這個設定關閉,就會改顯示彩色區塊而已,這會讓 VSCode 反應速度更快。
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
<?xml version="1.0" encoding="utf-16"?> | |
<StorableColorTheme xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<Keys> | |
<string>ErrorForegroundColor</string> | |
<string>ErrorBackgroundColor</string> | |
<string>WarningForegroundColor</string> | |
<string>WarningBackgroundColor</string> | |
<string>VerboseForegroundColor</string> | |
<string>VerboseBackgroundColor</string> | |
<string>DebugForegroundColor</string> |
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
// REF: [C#.NET][Thread] 執行緒同步資源鎖定 lock / SyncLock | |
// https://dotblogs.com.tw/yc421206/2011/01/07/20624 | |
private static List<Thread> _threads = new List<Thread>(); | |
private static object _thisLock = new object(); | |
static void Main() | |
{ | |
for (int i = 0; i < 5; i++) | |
{ |
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
void Main() | |
{ | |
Dictionary<string, string> dictionary1 = new Dictionary<string, string>() { { "1", "A" }, { "2", "A" } }; | |
Dictionary<string, string> dictionary2 = new Dictionary<string, string>() { { "2", "A" }, { "3", "A" } }; | |
dictionary1.AddRange(dictionary2).Dump(); | |
} | |
public static class DExtension | |
{ |
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
void Main() | |
{ | |
var data = new List<DemoModel>() { | |
new DemoModel{ Status ="A", Name ="1" }, | |
new DemoModel{ Status ="A", Name ="2" }, | |
new DemoModel{ Status ="B", Name ="3" }, | |
new DemoModel{ Status ="C", Name ="4" }, | |
new DemoModel{ Status ="B", Name ="5" } | |
}; | |
// Original: |
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
public class Startup | |
{ | |
public IServiceProvider ConfigureServices(IServiceCollection services) | |
{ | |
services.AddMvc().AddJsonOptions(options => | |
{ | |
options.SerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter()); | |
options.SerializerSettings.NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore; | |
}); | |
} |
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
void Main() | |
{ | |
SampleService.Instance.WhoAmI(); | |
SampleService.Instance.WhoAmI(); | |
} | |
// Define other methods and classes here | |
public class SampleService { | |
private static SampleService instance; | |
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 SampleService { | |
prizes = [{ numberOfWinner: 1, prizeItem: '獎項1' }, { numberOfWinner: 1, prizeItem: '獎項2' }]; | |
drawPrize: Iterator<any>; | |
*GetDrawPrize() { | |
for (let i = 0; i < this.prizes.length; i++) { | |
yield this.prizes[i]; | |
} | |
} |
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
export default class Singleton { | |
static instance; | |
constructor(){ | |
if(Singleton.instance){ | |
return Singleton.instance; | |
} | |
Singleton.instance = this; | |
} | |