Skip to content

Instantly share code, notes, and snippets.

@dax70
dax70 / index.html
Created June 26, 2013 03:24
A CodePen by Tharun Jose. Webandcrafts Logo - Pure CSS - WebandCrafts logo designed with border-radius, box-shadow and css transforms. Click the logo for exploded view. Exploded view inspiration: http://cdpn.io/nAGrf
<div id="container">
<div id="logo">
<div id="mask"></div>
<div id="curve4" class="left"></div>
<div id="curve3" class="left"></div>
<div id="curve2" class="right"></div>
<div id="curve1" class="right"></div>
<div id="curve5"></div>
</div>
</div>
@dax70
dax70 / index.html
Created June 26, 2013 03:24
A CodePen by Shubhra.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<div class="wrapper">
<section class="row">
<div class="container-item">
<div class="item">
<div class="item-overlay">
<a href="#" class="item-button play"><i class="play"></i></a>
<a href="#" class="item-button share share-btn"><i class="play"></i></a>
<div class="sale-tag"><span>SALE</span></div>
</div>
@dax70
dax70 / index.html
Created June 26, 2013 03:23
A CodePen by Andreas Storm. ios7 icon colors - colors by Louie Mantia opn dribbble
<!-- Colors by Louie Mantia
http://dribbble.com/shots/1118715-Colors?list=playoffs -->
<div class="color">
<div class='red'></div>
<div class='orange'></div>
<div class='yellow'></div>
<div class='green'></div>
<div class='lightblue'></div>
<div class='blue'></div>
<div class='darkblue'></div>
@dax70
dax70 / gist:3124907
Created July 16, 2012 20:40
Removing the X-AspnetMvc-Version Header
public class MvcApplication : HttpApplication
{
protected void Application_Start()
{
...
// Removes X-AspNetMvc-Version:4.0 from Response Headers
MvcHandler.DisableMvcResponseHeader = true;
}
}
@dax70
dax70 / gist:3124807
Created July 16, 2012 20:25
Removing the X-Aspnet-Version Header
<system.web>
<!-- Removes Response Header X-AspNet-Version -->
<httpRuntime enableVersionHeader="false" />
...
</system.web>
@dax70
dax70 / gist:3124173
Created July 16, 2012 18:28
Disabling Response Headers Code Centric
protected void Application_PreSendRequestHeaders(object sender, EventArgs e)
{
HttpContext.Current.Response.Headers.Remove("Server");
HttpContext.Current.Response.Headers.Remove("X-Powered-By"); // Disabled in config
HttpContext.Current.Response.Headers.Remove("X-AspNet-Version"); // Disabled in config
HttpContext.Current.Response.Headers.Remove("X-AspNetMvc-Version"); // Disabled on Application_Start
}
@dax70
dax70 / gist:2942622
Created June 16, 2012 21:57
Controller override for Json.NET
/// <summary>
/// Creates a System.Web.Mvc.JsonResult object that serializes the specified object to JavaScript Object Notation (JSON).
/// </summary>
/// <param name="data">The JavaScript object graph to serialize.</param>
/// <param name="contentType">The content type (MIME type).</param>
/// <param name="contentEncoding">The content encoding.</param>
/// <param name="behavior">The JSON request behavior</param>
/// <returns>
/// The JSON result object that serializes the specified object to JSON format.
/// The result object that is prepared by this method is written to the response
@dax70
dax70 / gist:2942515
Created June 16, 2012 21:14
EnumerableWrapper for JsonNET
using System;
using System.Collections.Generic;
using System.Linq;
namespace MvcJson.Net.Models
{
public class EnumerableWrapper<T>
{
public EnumerableWrapper(IEnumerable<T> items)
{
@dax70
dax70 / gist:2942507
Created June 16, 2012 21:03
JsonNetResult Logic
// Data (like the default JsonResult) is the Model being serialized.
Type type = this.Data.GetType();
// Wrap Enumerables to avoid potential Json Hijacking.
if (TypeHelper.TryWrappingForIEnumerableGenericOrSame(ref type))
{
this.Data = TypeHelper.GetTypeRemappingConstructor(type).Invoke(new object[] { this.Data });
}
using (JsonTextWriter jsonTextWriter = new JsonTextWriter(response.Output) { CloseOutput = false })
{