- 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
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
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
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
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
SELECT | |
sum(ddps.row_count) | |
FROM sys.indexes AS i | |
INNER JOIN sys.objects AS o ON i.OBJECT_ID = o.OBJECT_ID | |
INNER JOIN sys.dm_db_partition_stats AS ddps ON i.OBJECT_ID = ddps.OBJECT_ID | |
AND i.index_id = ddps.index_id | |
WHERE i.index_id < 2 AND o.is_ms_shipped = 0 |
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 string ToCamelCase(string text) | |
{ | |
if (text != null) | |
{ | |
var upperCount = 0; | |
while (upperCount < text.Length && char.IsUpper(text, upperCount)) | |
{ | |
upperCount++; | |
} | |
if (upperCount > 1 && upperCount < text.Length && char.IsLower(text, upperCount)) |
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
int 2 147 483 647 (2^32 / 2) - 2 billions | |
double 9 007 199 254 740 992 (2^53) - 9 quadrillions (millions of billions) | |
long 9 223 372 036 854 775 807 (2^64 / 2) - 9 quintillions (billions of billions) | |
decimal 79 228162514 264337593 543950335 (2^96) - 79 octillions (billions of billions of billions) | |
t/sql money 922 337 203 685 477 (2^63 / 1e4) - 900 trillions (millions of millions) | |
t/sql smallmoney 214 748 (2^31 / 1e4) - 200 thousands | |
t/sql numeric(38,4) 999999999..99 (1e34 - 1) - 9 decillion (millions of billions of billions of billions) |
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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Xml; | |
namespace tztest | |
{ | |
class Program | |
{ | |
private static XmlDocument LoadCldrXml(string path) |
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
// ==UserScript== | |
// @include * | |
// @noframes | |
// @grant unsafeWindow | |
// @grant GM_registerMenuCommand | |
// @grant GM_setClipboard | |
// ==/UserScript== | |
GM_registerMenuCommand('Copy URL', () => { |