Skip to content

Instantly share code, notes, and snippets.

View crazilazi's full-sized avatar
🎯
Focusing

Rajeev Ranjan crazilazi

🎯
Focusing
View GitHub Profile
@rekmarks
rekmarks / newProvider.js
Last active April 18, 2021 17:06
Using the New MetaMask Inpage Provider
// Running on the page, in the browser
// This API will go live in early 2020
// It will be the only API available after a 6-week deprecation period
if (!ethereum || !ethereum.isMetaMask) {
throw new Error('Please install MetaMask.')
}
/*********************************************************/
@meziantou
meziantou / ObjectDataReader.cs
Created February 1, 2017 00:28
ObjectDataReader (BulkInsert)
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));