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
@helper TrimmedList(IEnumerable<string> list) | |
{ | |
var fullList = list.ToListOrDefault(); | |
if (fullList.Count > 0) | |
{<text>@fullList[0]</text>} | |
if (fullList.Count > 1) | |
{<text>, <a rel="expand" href="javascript:;" title="@fullList.Skip(1).Join(", ")">...</a></text>} | |
} |
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
@helper TrimmedText(string text, int length) | |
{ | |
if (text.IsNullOrWhiteSpace()) | |
{ } | |
if (text.Length <= length) | |
{<text>@text</text>} | |
else | |
{<text>@text.Substring(0, length)<a rel="expand" href="javascript:;" title="@text.Substring(length)">...</a></text>} | |
} |
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
<% | |
' **************************************************************************** | |
' Sub: GetUtcOffsetMinutes | |
' Description: Gets the number of minutes between local time and UTC. | |
' | |
' Params: None | |
' **************************************************************************** | |
Function GetUtcOffsetMinutes() |
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 need references to System Center 2013 assemblies: | |
* Microsoft.EnterpriseManagement.Runtime | |
* Microsoft.EnterpriseManagement.OperationsManager | |
* Microsoft.EnterpriseManagement.Core | |
*/ | |
namespace SystemCenter.Utils |
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
// Inline unordered list seperated by bullets | |
ul.list-inline-bullet-seperated | |
{ | |
list-style-type: none; | |
li | |
{ | |
display: inline-block; | |
} | |
li:before | |
{ |
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
SELECT DATEADD(MINUTE, 1+DATEDIFF(MINUTE, 0, GETDATE()), 0) NearestMinute |
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
SELECT dateadd(hour, datediff(hour, 0, GETDATE()), 0) NearestHour |
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
{ | |
init: function(elevators, floors) { | |
var elevator = elevators[0]; // Let's use the first elevator | |
elevator.on("idle", function() { | |
// The elevator is idle, so let's go to all the floors (or did we forget one?) | |
elevator.goToFloor(0); | |
}); | |
elevator.on("floor_button_pressed", function(floorNum) { | |
elevator.goToFloor(floorNum, true); | |
}); |
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
{ | |
init: function(elevators, floors) { | |
var elevator = elevators[0]; // Let's use the first elevator | |
elevator.on("idle", function() { | |
// The elevator is idle, so let's go to all the floors (or did we forget one?) | |
elevator.goToFloor(2); | |
}); | |
elevator.on("floor_button_pressed", function(floorNum) { | |
elevator.goToFloor(floorNum, true); | |
}); |
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
// URL: http://play.elevatorsaga.com/#challenge=3 | |
{ | |
init: function(elevators, floors) { | |
function initElevator(elevator) { | |
elevator.on("idle", function() {}); | |
elevator.on("floor_button_pressed", function(floorNum) { | |
elevator.goToFloor(floorNum, true); | |
}); | |
elevator.on("passing_floor", function(floorNum, direction) { |