Skip to content

Instantly share code, notes, and snippets.

View JasonMore's full-sized avatar

Jason More JasonMore

  • Minneapolis, MN
View GitHub Profile
@JasonMore
JasonMore / gist:1036431
Created June 20, 2011 19:58 — forked from darrencauthon/gist:1036421
AutoMapperAssist example
Mapper.CreateMap<TestClass, TestClassViewModel>()
.ForMember(dest => dest.Bar, opt => opt.MapFrom(src => src.Foo));
var map = new Mapper<TestClass, TestClassViewModel>(Mapper.Engine);
@JasonMore
JasonMore / CallDirector.application.js
Created August 12, 2011 14:29
Seperating JS from the view
//javascript namespacing
//start class
var CallDirector_application = {};
(function () {
//private members
var $selectedMenuAction;
//public memeber
@JasonMore
JasonMore / Calldirector.application.js
Created August 26, 2011 16:24
javascript namespacing
/// <reference path="..\jquery-1.6.1-vsdoc.js"/>
/// <reference path="..\Calldirector.base.js"/>
//javascript namespacing
var CallDirector_application = {};
(function () {
//same as private
var messageWindow;
@JasonMore
JasonMore / todo.htm
Created March 20, 2012 17:54
Ugly backbone templating
<script type="text/template" id="item-template">
<div class="todo <%= done ? 'done' : '' %>">
<input class="check" type="checkbox" <%= done ? 'checked="checked"' : '' %> />
</div>
</script>
@JasonMore
JasonMore / backbone.htm
Created April 2, 2012 17:58
Backbone.js TODO app implemented in knockout.js
<!DOCTYPE html>
<html lang="en">
<head>
<title>Backbone.js Todos</title>
<link rel="stylesheet" href="todos.css"/>
</head>
<body>
@JasonMore
JasonMore / backbone.htm
Created April 2, 2012 17:58
Backbone.js TODO app implemented in knockout.js
<!DOCTYPE html>
<html lang="en">
<head>
<title>Backbone.js Todos</title>
<link rel="stylesheet" href="todos.css"/>
</head>
<body>
@JasonMore
JasonMore / gist:4156895
Created November 27, 2012 20:46
fast click events on mobile web
this.bindTouchEvents = function (targetElement, touchEndFunction, context) {
var _context = context;
var moved = false;
$(document).off("touchstart", targetElement);
$(document).off("touchmove", targetElement);
$(document).off("touchend", targetElement);
$(document).on("touchstart", targetElement, null, function (event) {
});
[assembly: WebActivator.PreApplicationStartMethod(typeof(IDM.CMS3.Web.Admin.App_Start.NinjectWebCommon), "Start")]
[assembly: WebActivator.ApplicationShutdownMethodAttribute(typeof(IDM.CMS3.Web.Admin.App_Start.NinjectWebCommon), "Stop")]
namespace IDM.CMS3.Web.Admin.App_Start
{
using System;
using System.Web;
using Microsoft.Web.Infrastructure.DynamicModuleHelper;
@JasonMore
JasonMore / WithRepo.cs
Created February 28, 2013 15:57
Session<T> with/without Repository
public interface IPersonRespository
{
Person GetPersonById(int id);
}
public class PersonRepository : IPersonRespository
{
ISession _session;
public PersonRepository(ISession session)
{
@JasonMore
JasonMore / CurrentSiteModelService.cs
Last active December 16, 2015 00:09
Using RavenDB Embadable Document Store with Machine.Fakes
using IDM.CMS3.Service.Cache;
using IDM.CMS3.Service.Database.RavenDB.Indexes;
using IDM.CMS3.Service.Models;
using IDM.CMS3.Service.ViewModels;
using Ninject;
using Raven.Client;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;