Skip to content

Instantly share code, notes, and snippets.

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

Salar Rabbal rabbal

🏠
Working from home
View GitHub Profile
@TaoK
TaoK / JQuerySerializeCheckbox.js
Created January 6, 2012 21:38
JQuery Serialize Method with Checkbox False Output
(function ($) {
$.fn.serialize = function (options) {
return $.param(this.serializeArray(options));
};
$.fn.serializeArray = function (options) {
var o = $.extend({
checkboxesAsBools: false
}, options || {});
@chaoaretasty
chaoaretasty / Readme
Created January 24, 2012 18:07
Timespan model binding for MVC3
=========================
Based on the Simple Time Picker Modelbinder by Sergi Papseit Valls
http://www.sharpedgesoftware.com/Blog/2011/06/08/simple-time-picker-model-binder-for-aspnet-mvc-3-and-how-to-save-it-to-sql-ce-4-using-ef-41
=========================
I tried the modelbinder above but found a few issues with it including not being able to deal with blank options or partially filled out TimeSpans. This is my current version of it (it is a bit messy I warn you).
This is designed to bind to nullable TimeSpans, I haven't tried it with non-nullable ones, but you can overcome this by adding a [Required] attribute. The features are:
@mgroves
mgroves / CustomerController.cs
Created February 15, 2012 03:38
Audit ActionFilter in ASP.NET MVC
public class CustomerController : Controller
{
public ViewResult Index()
{
return View();
}
public ViewResult Edit()
{
var existingCustomer = new Customer();
@kevinSuttle
kevinSuttle / meta-tags.md
Last active July 3, 2024 14:23 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags
@friism
friism / CookieTempDataProvider.cs
Created April 4, 2012 00:35
CookieTempDataProvider for ASP.NET
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Web;
using System.Web.Mvc;
namespace AppHarbor.Web.Mvc
@cbskgc
cbskgc / InsertionModeReplaceWithExample.cshtml
Created February 16, 2014 22:50
Supporting ReplaceWith for AjaxOption.InsertionMode: It is occasionally convenient to be able to update content including the target container. This avoids a separate container to wrap the partial view statement.
@{
var ajaxOptions = new AjaxOptions { UpdateTargetId = "form" };
var htmlAttributes = new { id = "form", data_ajax_mode = "replacewith" };
}
@using (Ajax.BeginForm("Index", null, ajaxOptions, htmlAttributes))
{
}
@GrantByrne
GrantByrne / UserValidator.cs
Created April 24, 2014 06:02
Using Fluent Validation with WPF - Dead Simple
using System.Text.RegularExpressions;
using FluentValidation;
using WpfFluentValidationExample.ViewModels;
namespace WpfFluentValidationExample.Lib
{
public class UserValidator : AbstractValidator<UserViewModel>
{
public UserValidator()
{
@meziantou
meziantou / WebFormsBootstrapValidation.aspx
Last active May 27, 2023 11:29
ASP.NET WebForms Validators & Bootstrap
<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>ASP.NET WebForms Validators & Bootstrap</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css" />
@Saanch
Saanch / structuremap.owin
Created July 16, 2015 01:41
structuremap OWIN middleware to handle the container per owin context
StructureMapOWINMiddleware in remplacement of the IHttpModule :
//basic draft
public class StructureMapOWINMiddleware : OwinMiddleware
{
public StructureMapOWINMiddleware(OwinMiddleware next)
: base(next)
{
}
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 8, 2024 17:50
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites