Skip to content

Instantly share code, notes, and snippets.

View thomascsd's full-sized avatar
🎯
Focusing

Thomas chang thomascsd

🎯
Focusing
View GitHub Profile
@thomascsd
thomascsd / TypeScript.json
Created December 31, 2020 08:20
routings-controller snippet
{
"Create service with inject": {
"prefix": "csd-service",
"body": [
"import { RestDbService } from './RestDbService';",
"import { Inject } from 'typedi';",
"import { ${1:Contact} } from '../../shared/models';",
"",
"@Inject()",
"export class ${1:Contact}Service {",
@thomascsd
thomascsd / gist:252d08d1c18f607184d026e237141588
Created April 8, 2020 09:26
SqlServer 清除Log的方式
找Log TableName
SELECT name, size/128.0 FileSizeInMB,
size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0
AS EmptySpaceInMB
FROM sys.database_files;
清Log
@thomascsd
thomascsd / medium01-sec01.ts
Created July 6, 2019 06:05
medium01-sec01
//public_api.ts
export * from './lib/header/header.component';
export * from './lib/shared-comp.module';
@thomascsd
thomascsd / sample.compoment.html
Created May 11, 2018 09:27
Enable swipe for tab in Angular material
<div class="md-content" flex md-scroll-y (swipeleft)="swipe(idx, $event.type)" (swiperight)="swipe(idx, $event.type)">
<md-tab-group md-stretch-tabs [(selectedIndex)]="selectedIndex" (selectedIndexChange)="selectChange()">
<md-tab label="Tab 1" (swipeleft)="swipe(1, $event.type)" (swiperight)="swipe(1, $event.type)">
Content 1
</md-tab>
<md-tab label="Tab 2" (swipeleft)="swipe(2, $event.type)" (swiperight)="swipe(2, $event.type)">Content 2</md-tab>
</md-tab-group>
</div>
@thomascsd
thomascsd / gist:459d8457b728e76e0960
Created December 18, 2015 01:13
AntiXSS v4.0中Sanitizer.GetSafeHtmlFragment等方法將部分漢字編碼爲亂碼的解決方案
String abc = //....你的某些賦值行爲,這裏的字符串是要處理的內容
.............
abc=Sanitizer.GetSafeHtmlFragment(abc);//被AntiXSS處理
abc=hfjString_SanitizerCompatibleWithChineseCharacters(abc);//使之漢字不出現亂碼
private static System.Collections.Generic.Dictionary<string, string> hbjDictionaryFX = new System.Collections.Generic.Dictionary<string, string>();
object hbObject鎖 = new object();
/// <summary>