Skip to content

Instantly share code, notes, and snippets.

Tim Hobbs timhobbs

Block or report user

Report or block timhobbs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View colorbox.less
@import "variables.less";
@import "mixins.less";
@import "buttons.less";
@import "modals.less";
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:10001; overflow:hidden;}
#cboxOverlay{position:fixed; width:100%; height:100%;}
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
View gist:b9a4d457ae935069c4d5
<!DOCTYPE html>
<html ng-app="app">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="" rel="stylesheet">
body { font-family: Calibri }
.form-horizontal .checkbox label {
timhobbs / gist:396310147fffbf8dc8d0
Created May 12, 2015
Angular controller communication via service
View gist:396310147fffbf8dc8d0
<!DOCTYPE html>
<html xmlns="" ng-app="app">
<link href="" rel="stylesheet">
<div class="container">
<div class="row">
timhobbs / sandbox.js
Created Jun 3, 2015
Javascript sandbox
View sandbox.js
* Just playing around with
* jsfiddle:
console.log("Basic function call");
timhobbs / DynamicDropDownsHelper.cshtml
Created Oct 22, 2011
Razor dynamic drop down helper
View DynamicDropDownsHelper.cshtml
@helper DynamicDropDowns() {
<script type="text/javascript">
function listChanged($list, $target, url) {
var listId = $list.val();
if (listId == "") { // User selected first option, so clear and disable the list
enableList($target, false);
$.getJSON(url, { id: listId }, function (data) {
timhobbs / MaximumWeightAttribute.cs
Created Oct 22, 2011
MaximumWeightAttribute custom attribute - usage [MaximumWeight("PropertyName", "PropertyValue", MaxWeightInt)]
View MaximumWeightAttribute.cs
public class MaximumWeightAttribute : ValidationAttribute, IClientValidatable {
private const string ERRORMSG = "Weight must not exceed {0} lbs.";
public string DependentProperty { get; set; }
public string DependentValue { get; set; }
public int MaximumWeight { get; set; }
public MaximumWeightAttribute(string dependentProperty, string dependentValue, int maximumWeight) {
this.DependentProperty = dependentProperty;
timhobbs / MaximumWeightAttribute.js
Created Oct 22, 2011
MaximumWeightAttribute custom attribute jQuery unobtrusive client side validation implementation
View MaximumWeightAttribute.js
<script type="text/javascript">
function (value, element, parameters) {
var carrier = $("#" + parameters["dependentproperty"]).val();
var carriervalue = parameters["dependentvalue"].toString();
var weightvalue = Number(parameters["weightvalue"]);
if (carrier == carriervalue && value > weightvalue) {
return false;
return true;
timhobbs / AjaxRedirect.cs
Created Oct 25, 2011
AjaxRedirectResult and AjaxRequestExtension
View AjaxRedirect.cs
using System;
using System.Web;
using System.Web.Mvc;
/// <summary>
/// See
/// for implementation details
/// </summary>
public class AjaxRedirectResult : RedirectResult {
timhobbs / jquery.text3d.js
Created Nov 15, 2011
jQuery 3d text plug-in
View jquery.text3d.js
* 3D Text plugin for jQuery
* v1.0
* Creates 3D text using CSS3 text-shadows
* By Craig Buckler, @craigbuckler,
* As featured on
timhobbs / Adapter.js
Created Oct 16, 2012 — forked from michaeljacobdavis/Adapter.js
NotEqual Fluent Validation validator with client side validation
View Adapter.js
(function ($) {
$.validator.addMethod("notequal", function (value, element, param) {
if (param.indexOf("#") == -1) return value != param;
return value != $(param).val();
}, $.validator.messages.notequal);
$.validator.unobtrusive.adapters.add("notequal", ["field"], function (options) {
options.rules["notequal"] = options.params.field;
if (options.message) options.messages["notequal"] = options.message;
You can’t perform that action at this time.