Skip to content

Instantly share code, notes, and snippets.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@coldhawaiian
coldhawaiian / gist:443fc9c4a868b01595b5
Created October 16, 2015 12:29 — 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
@coldhawaiian
coldhawaiian / gist:bc3379289f905086ea2f
Created October 16, 2015 12:29 — forked from jferguson/gist:1681888
Usage of SqlBulkCopy a Generic List<T>
var imports = new List<Product>();
//Load up the imports
//Pass in cnx, tablename, and list of imports
BulkInsert(context.Database.Connection.ConnectionString, "Products", imports);