Skip to content

Instantly share code, notes, and snippets.

View simonmurdock's full-sized avatar
🐟
Playing Slime Rancher 2

simonmurdock

🐟
Playing Slime Rancher 2
View GitHub Profile
@DavidMah
DavidMah / filedownloader.js
Created August 30, 2012 17:03
File Download requests using jquery/POST request with psuedo ajax
// Takes a URL, param name, and data string
// Sends to the server.. The server can respond with binary data to download
jQuery.download = function(url, key, data){
// Build a form
var form = $('<form></form>').attr('action', url).attr('method', 'post');
// Add the one key/value
form.append($("<input></input>").attr('type', 'hidden').attr('name', key).attr('value', data));
//send request
form.appendTo('body').submit().remove();
@lancscoder
lancscoder / Connection.cs
Created February 14, 2012 19:28
Dapper Getting Started
public class ConnectionFactory {
public static DbConnection GetOpenConnection() {
var connection = new SqlConnection("MyConnectionString");
connection.Open();
return connection;
}
}