Skip to content

Instantly share code, notes, and snippets.

View brendankowitz's full-sized avatar

Brendan Kowitz brendankowitz

View GitHub Profile
@brendankowitz
brendankowitz / gist:4167197
Created November 29, 2012 06:39
Better than revealing module pattern?
(function ($, exports) {
'use strict';
exports.Site = function (el) {
this.el = el;
/* Private Methods */
function initSearch() {
el.find("#site-search-form").submit(function (e) {
var searchInput = $(this).find("input[type='text']");
@brendankowitz
brendankowitz / gist:4071660
Created November 14, 2012 11:36
Umbraco IHttpModule to switch to an optional [TemplateAlias]Mobile template when mobile devices are detected
using System;
using System.Linq;
using System.Web;
using Kowitz.Core.Module;
using Microsoft.Web.Infrastructure.DynamicModuleHelper;
using ZeroProximity.DeviceDetection;
using umbraco;
using umbraco.cms.businesslogic.template;
[assembly: PreApplicationStartMethod(typeof(MobileRewriteModule), "Start")]