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
<#@ template language="C#" hostspecific="true" debug="true" #> | |
<#@ assembly name="System.Core" #> | |
<#@ assembly name="System.Windows.Forms" #> | |
<#@ assembly name="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #> | |
<#@ assembly name="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #> | |
<#@ import namespace="System.Collections" #> | |
<#@ import namespace="System.Globalization" #> | |
<#@ import namespace="System.Linq" #> | |
<#@ import namespace="System.IO" #> | |
<#@ import namespace="System.Reflection" #> |
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
public class PasswordHasher : IPasswordHasher | |
{ | |
public int Pbkdf2IterCount { get; set; } | |
public int Pbkdf2SubkeyLength { get; set; } | |
public int SaltSize { get; set; } | |
public PasswordHasher() | |
{ |
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
app.directive('input', ['$parse', function ($parse) { | |
/* | |
* Initialize model from input value | |
*/ | |
return { | |
restrict: 'E', | |
require: '?ngModel', | |
link: function (scope, element, attrs) { | |
if (attrs.ngModel && attrs.value) { | |
$parse(attrs.ngModel).assign(scope, attrs.value); |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<startup> | |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" /> | |
</startup> | |
<system.diagnostics> | |
<trace autoflush="true" indentsize="4"> | |
<listeners> | |
<remove name="Default" /> |
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
DECLARE @searchValue uniqueidentifier = 'a2843a1e-6ed4-4045-a179-51f0743943b8' | |
DECLARE @sql NVARCHAR(MAX); | |
WITH cte_sql_queries(sql_query) AS ( | |
-- SELECT '[dbo].[Customer]' FROM [dbo].[Customer] WHERE [Customer_Id]=@searchValue | |
SELECT 'SELECT ''' + QUOTENAME(t.TABLE_SCHEMA) + ''' schema_name ' | |
+ ' , ''' + QUOTENAME(t.TABLE_NAME) + ''' table_name ' | |
+ ' , ''' + QUOTENAME(c.COLUMN_NAME) + ''' column_name ' | |
+ ' , ''SELECT ' + QUOTENAME(c.COLUMN_NAME) + ', * FROM ' + QUOTENAME(t.TABLE_SCHEMA) + '.' + QUOTENAME(t.TABLE_NAME) + ' WHERE ' + QUOTENAME(c.COLUMN_NAME) + '='''''+ CAST(@searchValue AS NVARCHAR(36)) +''''''' query ' | |
+ ' FROM ' + QUOTENAME(t.TABLE_SCHEMA) + '.' + QUOTENAME(t.TABLE_NAME) |
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
module LazyLoader { | |
const attributeName = "data-src"; | |
function throttle(wait: number, func: () => any, immediate = false) { | |
var context: any; | |
var args: any; | |
var timeoutHandle: number; | |
var result: any; | |
var previous: Date; |
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
document.getElementById("OpenOneDrive").addEventListener("click", e => { | |
e.preventDefault(); | |
launchOneDrivePicker().then(result => { | |
if (result) { | |
for (const file of result.value) { | |
const name = file.name; | |
const url = file["@microsoft.graph.downloadUrl"]; | |
console.log({ name: name, url: url }); | |
fetch(url) |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
BenchmarkRunner.Run<StringBenchmark>(); | |
} | |
} | |
[OrderProvider(SummaryOrderPolicy.FastestToSlowest)] | |
[CoreJob] |
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
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ClassLibrary1 | |
{ | |
public abstract class RemoteDataCache<T> : IDisposable | |
{ | |
private readonly SemaphoreSlim _semaphoreSlim = new SemaphoreSlim(1, 1); | |
private CacheValue<T> _value; |
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
private void OnPaste(object sender, DataObjectPastingEventArgs e) | |
{ | |
HandleDataObject(e.DataObject); | |
e.Handled = true; | |
} | |
private void HandleDataObject(IDataObject data) | |
{ | |
if (data == null) throw new ArgumentNullException(nameof(data)); |
OlderNewer