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
// ==UserScript== | |
// @name 中英快速切換 - TW | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description MS Learn 文件中英文切換 | |
// @author You | |
// @match https://learn.microsoft.com/*/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=microsoft.com | |
// @downloadURL https://gist.githubusercontent.com/lettucebo/75f05f94b7ee2dace41b5ec06b6bf022/raw/548ae23f363124b5226d6c01181e1abe470f8574/ms-learn-lang-switch-tw.js | |
// @updateURL https://gist.githubusercontent.com/lettucebo/75f05f94b7ee2dace41b5ec06b6bf022/raw/548ae23f363124b5226d6c01181e1abe470f8574/ms-learn-lang-switch-tw.js |
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
// ==UserScript== | |
// @name 中英快速切換 - CN | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description MS Learn 文件中英文切換 | |
// @author You | |
// @match https://learn.microsoft.com/*/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=microsoft.com | |
// @downloadURL https://gist.githubusercontent.com/lettucebo/75f05f94b7ee2dace41b5ec06b6bf022/raw/548ae23f363124b5226d6c01181e1abe470f8574/ms-learn-lang-switch-cn.js | |
// @updateURL https://gist.githubusercontent.com/lettucebo/75f05f94b7ee2dace41b5ec06b6bf022/raw/548ae23f363124b5226d6c01181e1abe470f8574/ms-learn-lang-switch-cn.js |
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
# Based on http://nuts4.net/post/automated-download-and-installation-of-visual-studio-extensions-via-powershell | |
param([String] $PackageName) | |
$ErrorActionPreference = "Stop" | |
$baseProtocol = "https:" | |
$baseHostName = "marketplace.visualstudio.com" | |
$Uri = "$($baseProtocol)//$($baseHostName)/items?itemName=$($PackageName)" |
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
namespace ConsoleApp1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Handlers.RegisterGeography(); | |
using (var conn = new SqlConnection("")) | |
{ |
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 [master] | |
GO | |
/****** Object: Database [Sample] Script Date: 2/9/2020 1:20:27 PM ******/ | |
CREATE DATABASE [Sample] | |
GO | |
ALTER DATABASE [Sample] SET COMPATIBILITY_LEVEL = 150 | |
GO | |
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled')) | |
begin | |
EXEC [Sample].[dbo].[sp_fulltext_database] @action = 'enable' |
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
// init logger | |
DevelopLogger developLogger = new DevelopLogger(new LoggerConfiguration() | |
.MinimumLevel.Debug() | |
.Enrich.WithMachineName() | |
.Enrich.FromLogContext() | |
.WriteTo.Console() | |
.CreateLogger()); | |
UserLogger userLogger = new UserLogger(new LoggerConfiguration() | |
.MinimumLevel.Debug() |
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
// init logger | |
WsSerilog.UserLog = new LoggerConfiguration() | |
.MinimumLevel.Debug() | |
.Enrich.WithMachineName() | |
.Enrich.FromLogContext() | |
.WriteTo.Console() | |
.WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri("http://localhost:9200")) | |
{ | |
MinimumLogEventLevel = LogEventLevel.Information, | |
AutoRegisterTemplate = true, |
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
var imageModeration = | |
client.ImageModeration.EvaluateUrlInput("", new BodyModel("URL", imageUrl)); | |
Console.WriteLine($"IsImageAdultClassified: {imageModeration.IsImageAdultClassified}"); | |
Console.WriteLine($"AdultClassificationScore: {imageModeration.AdultClassificationScore}"); | |
Console.WriteLine($"IsImageRacyClassified: {imageModeration.IsImageRacyClassified}"); | |
Console.WriteLine($"RacyClassificationScore: {imageModeration.RacyClassificationScore}"); |
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
ContentModeratorClient client = new ContentModeratorClient(new ApiKeyServiceClientCredentials(apiKey)); | |
client.Endpoint = "https://southeastasia.api.cognitive.microsoft.com"; |
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
string apiKey = configuration.GetSection("apiKey").Value; | |
string imageUrl = "http://pic.pimg.tw/k110107632/1387547248-3785354604.jpg"; |
NewerOlder