This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
using System.Linq.Expressions; | |
public static class LabelExtensions | |
{ | |
public static MvcHtmlString LabelFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression, object htmlAttributes) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
** Unobtrusive Ajax support library for jQuery | |
** Copyright (C) Microsoft Corporation. All rights reserved. | |
*/ | |
/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */ | |
/*global window: false, jQuery: false */ | |
(function ($) { | |
var data_click = "unobtrusiveAjaxClick", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Color(r, g, b) { | |
var _r = r ? r : 0; | |
var _g = g ? g : 0; | |
var _b = b ? b : 0; | |
function getColorValue(value){ | |
if(value > 255) { | |
return 255; | |
}else if(value < 0) { | |
return 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var types = AppDomain.CurrentDomain.GetAssemblies() | |
.SelectMany(assem => assem.GetTypes() | |
.Select(t => t) | |
.Where(t => t.FullName.Contains("Namespace.Foo")) | |
.Where(t => Attribute.GetCustomAttributes(t, typeof(BarAttribute)).Length > 0) | |
.Select(t => t) | |
); | |
foreach(Type typ in types) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.extend({ | |
distinct: function (array) { | |
var u = {}, a = []; | |
for(var i = 0, l = array.length; i < l; ++i){ | |
if(u.hasOwnProperty(array[i])) { | |
continue; | |
} | |
a.push(array[i]); | |
u[array[i]] = 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* Datepicker for Bootstrap | |
* | |
* Copyright 2012 Stefan Petre | |
* Licensed under the Apache License v2.0 | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
*/ | |
.datepicker { | |
top: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/ruby | |
# -*- coding: utf-8 -*- | |
if `git rev-parse --verify HEAD 2>/dev/null` | |
then | |
against="HEAD" | |
else | |
# Initial commit: diff against an empty tree object | |
against="4b825dc642cb6eb9a060e54bf8d69288fbee4904" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Date.prototype.getMonthLength = function() { | |
return this.getMonthLast().getDate(); | |
} | |
Date.prototype.getPrevMonth = function() { | |
return this.dateAdd("month", -1); | |
} | |
Date.prototype.getNextMonth = function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("input[data-type=integer]").on("blur", function(){ | |
var value = $(this).val(); | |
if(!$.isNumeric(value)) { | |
$(this).val(""); | |
return; | |
} | |
$(this).val(Math.floor(value)); | |
}); | |
$("input[data-type=float]").on("blur", function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
var currentScroll = 0; | |
var smoothScroll = function(event){ | |
var delta = 0; | |
if (!event) /* IE */ | |
event = window.event; | |
if (event.wheelDelta) { /* IE/Opera. */ | |
delta = event.wheelDelta/120; | |
if (window.opera) { | |
delta = -delta; |
OlderNewer