Skip to content

Instantly share code, notes, and snippets.

//////////////////Behavior
public class TransactionalContainerBehavior : IActionBehavior
{
private readonly IContainer _container;
private readonly ServiceArguments _arguments;
private readonly Guid _behaviorId;
public TransactionalContainerBehavior(IContainer container, ServiceArguments arguments, Guid behaviorId)
{
@rauhryan
rauhryan / ajax.js
Created October 22, 2011 00:10 — forked from mikeobrien/ajax.js
Boiler plate code to delete a record + row
(function($){
$.addAjaxItemDeleteHandler = function(options) {
var defaults = {
url: 'delete',
data: function(id) { return { Id: id }; },
deleteElementClass: 'item-delete',
deleteElementIdAttribute: 'data-id',
deleteElementDescriptionAttribute: 'data-description',
deleteRowClass: 'item-row',
deleteRowIdAttribute: 'data-id',
// avoid duplicate primitives, use an object instead
// Func<string, string, bool, bool, bool> becomes Func<Foo, bool>
public class Foo
{
public string ErrorMessage {get;set;}
public string SuccessMessage {get;set;}
}
public static bool dynamicMethodGeneration(Func<Foo, bool> success, Func<Foo, bool> onError)
function callAjax(){
$.ajax({
url: "url",
data: {
value: "derp"
},
dataType: "json",
success: function(data){
//do stuffs
},
(function($,window) {
// doc ready
$(function(){
$("select.select").each(function(){
$(this).change(function() {
$.ajax({
url: "url",
data: {
@rauhryan
rauhryan / README.md
Last active December 15, 2015 19:49 — forked from mbostock/.block

This chart shows a histogram of a log-normal distribution of time durations. The data is randomly generated: each value is a number representing a duration measured in minutes. The values are then binned at regular intervals using D3’s histogram layout. A custom tick format for the x-axis converts these numbers to dates before passing them through a d3.time.format. The x-axis uses a linear scale, such that the tick values appear in-between bars; this provides better indication that each bar represents the count of values between its surrounding tick values.

See also this histogram of an Irwin–Hall distribution.