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
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
uploaderApp.service('S3UploadService', ['$q', function ($q) { | |
// Us standard region | |
AWS.config.region = 'us-east-1'; | |
AWS.config.update({ accessKeyId: '**myAccessKeyId**', secretAccessKey: '**mySecretAccessKey**' }); | |
var bucket = new AWS.S3({ params: { Bucket: 'myTempBucket', maxRetries: 10 }, httpOptions: { timeout: 360000 } }); | |
this.Progress = 0; | |
this.Upload = function (file) { | |
var deferred = $q.defer(); |
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
// JavaScript source code | |
var uploaderApp = angular.module('uploaderApp', ['ngFileUpload']); | |
uploaderApp.run(); | |
uploaderApp.controller('UploadController', ['$scope', 'Upload', 'S3UploadService', function ($scope, Upload, S3UploadService) { | |
$scope.uploadFiles = function (files) { | |
$scope.Files = files; | |
if (files && files.length > 0) { |
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
myApp.directive("jplayer", ['$window', 'PlayerService', function ($window, PlayerService) { | |
return { | |
restrict: "E", | |
// Have our own scope - we only want to watch the service and not conflict with other scopes | |
scope: {}, | |
// Serve up some html with our player | |
templateUrl: "/jplayer-template.html", | |
link: function (scope, element, attrs) { | |
// An element on the page to attach the jPlayer to. Could also use "element" from linkFN ^ | |
var jPlayer = angular.element("#jquery_jplayer_1").jPlayer(); |
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) |
NewerOlder