Skip to content

Instantly share code, notes, and snippets.

@dax70
dax70 / CSS Formatting
Created June 11, 2012 23:57
Example of CSS formatting ala Twitter Bootstrap
.border {
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.15);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
@dax70
dax70 / gist:2760442
Created May 21, 2012 03:30
A better IContractResolver for Json.NET
using System;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace MvcJson
{
public class ConfigurableContractResolver: DefaultContractResolver
{
public bool UseCamelCase { get; set; }
@dax70
dax70 / gist:2760197
Created May 21, 2012 01:18
Json.Net Settings example of ContractResolver
var settings = new JsonSerializerSettings
{
ContractResolver = new ConfigurableContractResolver()
}
JsonSerializer serializer = JsonSerializer.Create(settings);
serializer.Serialize(textWriter, valueToSerialize);
@dax70
dax70 / dabblet.css
Created May 5, 2012 06:13 — forked from anonymous/dabblet.css
Image Shadow
img {
position: relative;
display: block;
content: "";
}
img:before {
display: block;
content: "";
position: absolute;
@dax70
dax70 / dabblet.css
Created May 5, 2012 05:59
Image/Profile look
html {
background: #f6f6f6;
padding: 24px;
text-align: center;
}
a {
border-radius: 4px;
display: inline-block;
html {
background: #f6f6f6;
padding: 24px;
text-align: center;
}
a {
border-radius: 4px;
display: inline-block;
@dax70
dax70 / gist:1126337
Created August 4, 2011 21:33
KnockoutJS updating observables
function Model(){
this.selectedItems = ko.observableArray();
this.selectNone = function () {
this.selectedItems().length = 0;
this.selectedItems.valueHasMutated();
}
this.hasItemsSelected = ko.dependentObservable(function () {
return this.selectedItems().length > 0;
}, this);
}