Skip to content

Instantly share code, notes, and snippets.

View dgomesbr's full-sized avatar
🏠
Working from home

Diego Magalhães dgomesbr

🏠
Working from home
View GitHub Profile
@dgomesbr
dgomesbr / Category.cs
Created February 9, 2012 20:14
Mapeamento da classe Categoria no NHibernate 3.2
using NHibernate.Driver;
using NHibernate.Mapping.ByCode;
using NHibernate.Mapping.ByCode.Conformist;
namespace workshop_Entity
{
public class Category
{
public virtual int IdCategoria { get; set; }
public virtual string Nome { get; set; }
@dgomesbr
dgomesbr / NHibernateHttpModule.cs
Created February 9, 2012 20:08
NHibernateHttpModule.cs depois do resharper
using System;
using System.Web;
using NHibernate;
using NHibernate.Cfg;
namespace workshop_httpmodule
{
public class NHibernateHttpModule : IHttpModule
{
public static readonly string NHibernateSessionKey = "NHibernateSession";
@dgomesbr
dgomesbr / ContentHelper.cs
Created February 6, 2012 19:28
ASP.NET MVC 2 Html.ImageActionLink Helper using Microsoft.Web.Mvc
// After using the Microsoft.Web.Mvc Html.ActionLink<TController>(... Expression<Action<TController>> action ...);
// I was unable to use that for a Image, so here's the code for it:
// **** :) no more magic strings for image linking to actions.
// usage:
// <%= Html.ImageActionLink<HomeController>(
// x => x.ChangeCulture(Culture.pt, this.Request.RawUrl),
// Culture.pt.ToString() + ".png")
// %>
@dgomesbr
dgomesbr / gist:1140687
Created August 11, 2011 20:34
Zebra Stripe tables :)
$(document).ready(function(){
$(".stripeMe tr").on{
mouseover: function()
{
$(this).addClass("over");
}
mouseleave: function()
{
$(this).removeClass("over");
}