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
public class ContextMocker | |
{ | |
public ContextMocker(string [] qKeys = null) | |
{ | |
ILogger loggerMock = Mock.Of<ILogger>(); | |
IProfiler profilerMock = Mock.Of<IProfiler>(); | |
var contextBaseMock = new Mock<HttpContextBase>(); | |
if (qKeys != null) | |
{ | |
var requestMock = new Mock<HttpRequestBase>(); |
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
<div ng-controller="Umbraco.PropertyEditors.ColorPickerController"> | |
<ul class="thumbnails color-picker"> | |
<li ng-repeat="preval in model.prevalues" ng-class="{active: model.value === preval}"> | |
<a ng-click="toggleItem(preval)" class="thumbnail" hex-bg-color="{{preval}}"> | |
</a> | |
</li> | |
</ul> | |
<input type="hidden" name="modelValue" ng-model="model.value" val-property-validator="validateMandatory"/> | |
</div> |
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
static void Main(string[] args) | |
{ | |
var youtubeService = new YouTubeService(new BaseClientService.Initializer() | |
{ | |
ApiKey = "appKey", | |
ApplicationName = "TestYouTubeApi" | |
}); | |
var request = youtubeService.Videos.List("snippet,contentDetails,statistics,status,player,topicDetails,recordingDetails"); | |
var EndOfURI = "someVideoId"; |
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
public class RssActionResult : ActionResult | |
{ | |
public SyndicationFeed Feed { get; set; } | |
public override void ExecuteResult(ControllerContext context) | |
{ | |
context.HttpContext.Response.ContentType = "application/rss+xml"; | |
var rssFormatter = new Rss20FeedFormatter(Feed); | |
using (var writer = XmlWriter.Create(context.HttpContext.Response.Output)) | |
{ |
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
public static class AutofacConfig | |
{ | |
public static void RegisterDependencies() | |
{ | |
var builder = new ContainerBuilder(); | |
// Register Umbraco Context, MVC Controllers and API Controllers. | |
builder.Register(c => UmbracoContext.Current).AsSelf(); | |
builder.RegisterInstance(new UmbracoHelper(UmbracoContext.Current)); |
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
public static int solution(int[] A) | |
{ | |
var maxDepth = int.MaxValue; | |
var counter = 0; | |
for (int i = 1; i < A.Length - 1; i++) | |
{ | |
var current = A[i]; | |
var previous = A[i - 1]; | |
var next = A[i + 1]; |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace algos | |
{ | |
class Program | |
{ |
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
public static int solution(string S) | |
{ | |
var index = 0; | |
if(string.IsNullOrEmpty(S) || S.Length%2 == 0) | |
{ | |
index = -1; | |
} | |
else if(S.Length == 1) | |
{ | |
index = 0; |
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
public static int solution(int[] A) | |
{ | |
Array.Sort(A); | |
var r = Math.Max(A[A.Length - 1] * A[A.Length- 2] * A[A.Length - 3], | |
A[0] * A[1] * A[A.Length - 1]); | |
return r; | |
} |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace algos | |
{ | |
class Program | |
{ |