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.Collections.Generic; | |
using System.Linq; | |
using System.Web.Mvc; | |
using App.Utilities; | |
namespace App.Helpers | |
{ | |
public static class ActionResultExtensions | |
{ |
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
// Drop ModelWithEnum.ThingTypeDictionary into a ViewModel that gets serialized to JSON | |
// for handy, scalable use of enums in JavaScript. For example, you can change | |
// | |
// | |
// if (m.ThingTypeId === 3) | |
// | |
// to | |
// | |
// if (m.ThingTypeId === model.ThingTypeDictionary.Spaceship) |
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
// 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; |
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
// 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 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
typedef NS_OPTIONS(NSInteger, LightState) { | |
LightStateOff = 0, | |
LightStateOn = 1 << 0, | |
LightStateToggle = 1 << 1, | |
LightStatePulse = 1 << 2, | |
LightStateStrobe = 1 << 3 | |
}; |
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
.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 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($) { | |
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 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
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> | |
<%= Html.WriteToJavaScript(Model, "window.model") %> | |
</asp:Content> |
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.Web; | |
using System.Web.Optimization; | |
using BundleTransformer.Core.Transformers; | |
namespace Project { | |
public class BundleConfig { | |
public static void RegisterBundles(BundleCollection bundles) { |
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 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; |