This file contains 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.Net; | |
using System.Web.Mvc; | |
namespace ProjectName.Controllers | |
{ | |
public class ErrorController : Controller | |
{ | |
public ViewResult NotFound() { | |
Response.StatusCode = (int)HttpStatusCode.NotFound; |
This file contains 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
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<string>" %> | |
<% string defaultCountry = "United States"; | |
if (ViewData.ContainsKey("default")) { | |
defaultCountry = (string)ViewData["default"]; | |
} | |
%> | |
<select id="<%= Html.IdFor(model => model) %>" name="<%= ViewData.TemplateInfo.HtmlFieldPrefix %>"<% if (ViewData.ContainsKey("html")) { foreach (var a in HtmlHelper.AnonymousObjectToHtmlAttributes(ViewData["html"])) { %> <%= a.Key %>="<%= a.Value %>"<% } } %>> | |
<% if (String.IsNullOrWhiteSpace(Model) && !Inspect.Models.Location.Countries.Keys.Contains(defaultCountry)) { %><option value="<%: defaultCountry %>"><%: defaultCountry %></option><% } %> | |
<% foreach (var country in Inspect.Models.Location.Countries.Keys) { %> |
This file contains 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 auburnBuildingNames; | |
window.getAuburnBuildingNames = function(callback) { | |
if (auburnBuildingNames) { | |
callback(auburnBuildingNames); | |
} else { | |
var buildings; | |
$.getJSON("https://cws.auburn.edu/map/api/3.0/building", function(data) { | |
buildings = $.map(data, function(building, i) { | |
return building.name; |
This file contains 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.Web; | |
using System.Web.Optimization; | |
using BundleTransformer.Core.Transformers; | |
namespace Project { | |
public class BundleConfig { | |
public static void RegisterBundles(BundleCollection bundles) { |
This file contains 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
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> | |
<%= Html.WriteToJavaScript(Model, "window.model") %> | |
</asp:Content> |
This file contains 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($) { | |
function getTextWidth($element) { | |
var tester = $("<div/>").text($element.text()) | |
.css({ "position": "absolute", "float": "left", "white-space": "nowrap", "visibility": "hidden", "font": $element.css("font"), "text-transform": $element.css("text-transform"), "letter-spacing": $element.css("letter-spacing") }) | |
.appendTo($element.parent()), | |
width = tester.innerWidth(); | |
tester.remove(); | |
return width; | |
} |
This file contains 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
.select2-container .select2-choice { | |
height: 34px; | |
-webkit-box-shadow: none; | |
-moz-box-shadow: none; | |
box-shadow: none; | |
background-color: #fff; | |
background-image: none; | |
background: #fff; | |
} |
This file contains 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
typedef NS_OPTIONS(NSInteger, LightState) { | |
LightStateOff = 0, | |
LightStateOn = 1 << 0, | |
LightStateToggle = 1 << 1, | |
LightStatePulse = 1 << 2, | |
LightStateStrobe = 1 << 3 | |
}; |
This file contains 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
// This function courtesy of lostsource: http://stackoverflow.com/questions/13382516 | |
function getScrollbarWidth() { | |
var outer = document.createElement("div"); | |
outer.style.visibility = "hidden"; | |
outer.style.width = "100px"; | |
document.body.appendChild(outer); | |
var widthNoScroll = outer.offsetWidth; | |
outer.style.overflow = "scroll"; | |
var inner = document.createElement("div"); | |
inner.style.width = "100%"; |
This file contains 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
// You could put more information and functionality here if you want. | |
// I just needed an exception distinguishable from other exceptions. | |
// I implemented a "FindOrDie" method in my repository code, from which | |
// I throw this exception whenever a query comes up empty. | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; |
OlderNewer