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
public class HomeController : Controller | |
{ | |
private readonly BufferBlock<CompetitionEntry> _bufferBlock; | |
private readonly ILogger<HomeController> _logger; | |
public HomeController(BufferBlock<CompetitionEntry> bufferBlock, ILogger<HomeController> logger) | |
{ | |
_bufferBlock = bufferBlock; | |
_logger = logger; | |
} |
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
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddControllersWithViews(); | |
// Setup the DataFlow | |
// CSV File Setup (do/check this one time at application start) | |
if (!File.Exists("entries.csv")) | |
{ | |
// If it doesn't exist, write the header line |
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
<form id="subscribeForm"> | |
<input id="email-input" type="text" /> | |
<button type="submit">Submit</button> | |
</form> |
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 isDefinedAndNotNull(property) { | |
return property !== undefined && property !== null; | |
}; | |
angApp.directive("radioTrackBy", [function () { | |
return { | |
restrict: "A", | |
scope: { | |
ngModel: "=", | |
ngValue: "=", |
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
/// <binding BeforeBuild='beforeBuild' /> | |
/* | |
This file in the main entry point for defining Gulp tasks and using Gulp plugins. | |
Click here to learn more. http://go.microsoft.com/fwlink/?LinkId=518007 | |
*/ | |
var gulp = require('gulp'); | |
var webRoot = "./wwwroot/"; |
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
app.filter('textfilter', [function() { | |
return function (input) { | |
if (arguments.length > 1) { | |
// If we have more than one argument (insertion values have been given) | |
var str = input; | |
// Loop through the values we have been given to insert | |
for (var i = 1; i < arguments.length; i++) { | |
// Compile a new Regular expression looking for {0}, {1} etc in the input string | |
var reg = new RegExp("\\{" + (i-1) + "\\}"); | |
// Perform the replace with the compiled RegEx and the value |
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 Autofac; | |
using Microsoft.Azure.WebJobs.Host; | |
namespace WebJob1 | |
{ | |
public class AutofacActivator : IJobActivator | |
{ | |
private readonly IContainer _container; | |
public AutofacActivator(IContainer container) |
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.IO; | |
using Microsoft.Azure.WebJobs; | |
namespace WebJob1 | |
{ | |
public class Functions | |
{ | |
// This function will get triggered/executed when a new message is written | |
// on an Azure Queue called queue. | |
public static void ProcessQueueMessage([QueueTrigger("queue")] string message, TextWriter log) |
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 promise1 = getFirstValue().then(function (value) { | |
return value; | |
}); | |
// DON'T DO THIS | |
var p2 = $q.defer(); | |
p2.resolve("A value that is instant but we're faffing around with it"); | |
var promise2 = p2.deferred; | |
var promise3 = getThirdValue().then(function (value) { |
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 promise1 = getFirstValue().then(function (value) { | |
return value; | |
}); | |
// We can just return a value without creating a promise if we don't need. | |
var promise2 = "A value that is instant"; | |
var promise3 = getThirdValue().then(function (value) { | |
return value; | |
}); |
NewerOlder