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 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)); |
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.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 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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
BenchmarkRunner.Run<StringBenchmark>(); | |
} | |
} | |
[OrderProvider(SummaryOrderPolicy.FastestToSlowest)] | |
[CoreJob] |
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
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 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
improveFileUpload(); | |
function improveFileUpload() { | |
const input = document.getElementById("FileUpload"); | |
if (!input) { | |
console.warn("input not found."); | |
return; | |
} | |
if (!(input instanceof HTMLInputElement)) { |
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 class ObjectDataReader<T> : DbDataReader | |
{ | |
private IEnumerator<T> _iterator; | |
private IDictionary<string, int> _propertyNameToOrdinal = new Dictionary<string, int>(); | |
private IDictionary<int, string> _ordinalToPropertyName = new Dictionary<int, string>(); | |
private Func<T, object>[] _getPropertyValueFuncs; | |
public ObjectDataReader(IEnumerator<T> items) | |
{ | |
_iterator = items ?? throw new ArgumentNullException(nameof(items)); |
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
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 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title></title> | |
</head> | |
<body> | |
<h1>Audio</h1> |
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 @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 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
<%@ Page Language="C#" AutoEventWireup="true" %> | |
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head runat="server"> | |
<title>ASP.NET WebForms Validators & Bootstrap</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" /> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css" /> |