Skip to content

Instantly share code, notes, and snippets.

View jferguson's full-sized avatar

Jarod Ferguson jferguson

View GitHub Profile
@jferguson
jferguson / 1.1.1 test theme
Created July 20, 2012 07:44
jqm 1.1.1 theme
/*
* jQuery Mobile Framework 1.1.1 1981b3f5ec22675ae47df8f0bdf9622e7780e90e
* http://jquerymobile.com
*
* Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
*/
/* Swatches */
@jferguson
jferguson / 1.1.0 Original
Created July 20, 2012 07:41
jqm 1.0.1 rolled theme
/*
* jQuery Mobile Framework 1.0.1
* http://jquerymobile.com
*
* Copyright 2011-2012 (c) jQuery Project
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
*/
@jferguson
jferguson / gist:2244773
Created March 29, 2012 23:09
.Net Phaxio - Send Fax w /HttpClient
var fax = new Dictionary<string, string>
{
{"to", 8885551212},
{"string_data", "<div>This is your fax in html, will fax just like it renders in webkit, cool huh?</div>")},
{"string_data_type", "html"},
{"api_key", apiKey},
{"api_secret", apiSecret},
{"callback_url", "http://yourwebsite.com/fax/receipt"}
};
@jferguson
jferguson / gist:2244756
Created March 29, 2012 23:07
.Net Phaxio Integration : Fax Callback w MVC
public class FaxController : Controller
{
public void Receipt(FormCollection faxreceipt)
{
var direction = faxreceipt["direction"];
var isTest = faxreceipt["is_test"];
var faxData = faxreceipt["fax"];
var fax = JsonConvert.DeserializeObject<Fax>(faxData);
//do something w/ fax
@jferguson
jferguson / gist:2047357
Created March 15, 2012 22:22
Query an EF View with SqlQuery<T>
[TestFixture]
public class QuerySomeView
{
[Test]
public void DoIt()
{
var context = new StoreContext();
var results = context.Database.SqlQuery<ReadModel>("SELECT * FROM SomeView").ToList();
Assert.AreEqual(results.Count(), 2);
}
@jferguson
jferguson / gist:1681888
Created January 26, 2012 09:12
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);
@jferguson
jferguson / gist:1681480
Created January 26, 2012 07:12
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