Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Rauh rauhryan

View GitHub Profile
View README.md

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.

View derp.js
(function($,window) {
// doc ready
$(function(){
$("select.select").each(function(){
$(this).change(function() {
$.ajax({
url: "url",
data: {
View gist:3380321
function callAjax(){
$.ajax({
url: "url",
data: {
value: "derp"
},
dataType: "json",
success: function(data){
//do stuffs
},
View foo.cs
// 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)
@rauhryan
rauhryan / ajax.js
Created Oct 22, 2011 — forked from mikeobrien/ajax.js
Boiler plate code to delete a record + row
View ajax.js
(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',
View gist:1302008
//////////////////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)
{
You can’t perform that action at this time.