- https://github.com/allegro/restapi-guideline
- https://community.cisco.com/t5/nso-developer-hub-documents/rest-api-basics/ta-p/3635342
- https://www.ibm.com/support/knowledgecenter/en/SSNS6R_2.2.5/doc/rest/rar_vyatta_vpn.html
- https://opendistro.github.io/for-elasticsearch-docs/docs/alerting/api/
- https://developer.github.com/v4/query/
- https://app.tmetric.com/api-docs/#/Tasks/post-accounts-accountId-tasks
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
msBuildLog.replace(/^.*"([\w\.]+), Culture=(\w+), PublicKeyToken=(\w+)".*to Version "([\d\.]+)".*/gm, | |
`<dependentAssembly> | |
<assemblyIdentity name="$1" publicKeyToken="$3" culture="$2" /> | |
<bindingRedirect oldVersion="0.0.0.0-$4" newVersion="$4" /> | |
</dependentAssembly>`) |
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
using Newtonsoft.Json.Linq; | |
using System; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using System.Windows.Forms; | |
namespace WindowsFormsApp1 | |
{ | |
public partial class Form1 : Form | |
{ |
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
function objToParams(obj: any) { | |
let params = new URLSearchParams(); | |
for (let name in obj) { | |
let value = obj[name]; | |
if (Array.isArray(value)) { | |
for (let item of value) { | |
params.append(name, item); | |
} | |
} else { | |
params.set(name, value) |
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
private static readonly Regex[] _htmlReplaces = new[] { | |
new Regex(@"<script\b[^<]*(?:(?!</script>)<[^<]*)*</script>", RegexOptions.Compiled | RegexOptions.Singleline, TimeSpan.FromSeconds(1)), | |
new Regex(@"<style\b[^<]*(?:(?!</style>)<[^<]*)*</style>", RegexOptions.Compiled | RegexOptions.Singleline, TimeSpan.FromSeconds(1)), | |
new Regex(@"<[^>]*>", RegexOptions.Compiled), | |
new Regex(@" +", RegexOptions.Compiled) | |
}; | |
public static string HtmlToPlainText(string html) | |
{ | |
foreach (var r in _htmlReplaces) |
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
select | |
count = count(*), | |
db_name = db_name(database_id), | |
status, | |
login_name, | |
host_name, | |
program_name | |
from sys.dm_exec_sessions | |
where is_user_process = 1 | |
group by database_id, status, login_name, host_name, program_name |
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
DECLARE @Indexes table (TableName nvarchar(MAX), IndexName nvarchar(MAX), Value int) | |
INSERT INTO @Indexes | |
SELECT | |
QuoteName(s.name) + '.' + QuoteName(t.name) as TableName, | |
QuoteName(i.name) as IndexName, | |
avg_fragmentation_in_percent as Value | |
FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, NULL) AS ips | |
INNER JOIN sys.tables t on t.object_id = ips.object_id | |
INNER JOIN sys.schemas s on t.schema_id = s.schema_id | |
INNER JOIN sys.indexes AS i ON i.object_id = ips.object_id |
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 static class AsyncHelper | |
{ | |
public static T RunSync<T>(Func<Task<T>> action) | |
{ | |
try | |
{ | |
var result = default(T); | |
Task.Run(async () => | |
{ | |
result = await action(); |
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 MixinHello = <T extends new (...args: any[]) => A>(base: T) => | |
class extends base { | |
hello() { } | |
}; | |
class A { | |
a() { } | |
} | |
class B extends A { |
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
namespace Razor.Mail | |
{ | |
public class RawString | |
{ | |
private readonly string _text; | |
public RawString(string text) => _text = text; | |
public override string ToString() | |
{ |