Skip to content

Instantly share code, notes, and snippets.

View danieleli's full-sized avatar

Dan Schlossberg danieleli

View GitHub Profile
@danieleli
danieleli / OAuth.py
Created February 27, 2013 03:57 — forked from spaomalley/OAuth.py
import base64
import datetime
import hmac
import hashlib
from hashlib import md5
import random
import re
import time
import urllib
import urllib2
@danieleli
danieleli / gist:2578525
Created May 2, 2012 17:34 — forked from jferguson/gist:1681480
SqlBulkCopy Generic List<T>
public static void BulkInsert<T>(string connection, string tableName, IList<T> list)
{
using (var bulkCopy = new SqlBulkCopy(connection))
{
bulkCopy.BatchSize = list.Count;
bulkCopy.DestinationTableName = tableName;
var table = new DataTable();
var props = TypeDescriptor.GetProperties(typeof(T))
//Dirty hack to make sure we only have system data types