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 static class HelpPageConfig | |
{ | |
public static void Register(HttpConfiguration config) | |
{ | |
var path = HostingEnvironment.MapPath("~/App_Data/XmlDocument.xml"); | |
if (!string.IsNullOrWhiteSpace(path)) | |
{ | |
config.SetDocumentationProvider( | |
new XmlDocumentationProvider(path)); | |
} |
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
userManager.UserTokenProvider = new EmailTokenProvider<IdentityUser, Guid>(); |
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
IDataProtectionProvider provider = app.GetDataProtectionProvider(); | |
if (provider != null) | |
{ | |
userManager.UserTokenProvider = new DataProtectorTokenProvider<IdentityUser, Guid>(provider.Create("User Tokens")); | |
} |
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
[TestClass] | |
public class TestBase | |
{ | |
private static TestServer server; | |
public static TestServer Server | |
{ | |
get { return server; } | |
} |
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
[TestClass] | |
public class AccountsTests : TestBase | |
{ | |
[TestMethod] | |
public async Task Register_Returns_Successfull() | |
{ | |
var registerModel = new RegisterModel | |
{ | |
Email = Constants.USER_EMAIL, | |
FirstName = "Shawn", |
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
Import-Module Azure | |
Import-AzurePublishSettingsFile "C:\Certificate\Azure.publishsettings" | |
Write-Host "Swapping staging and production slots..." | |
Switch-AzureWebsiteSlot -Name "griklyapi" -Slot1 "production" -Slot2 "staging" -Force | |
Write-Host "Swap complete" |
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 request = require('request'); | |
var lineReader = require('line-reader'); | |
var selection = 1; // <- the id of the person to vote for | |
lineReader.eachLine('proxy.txt', function(line, last) { | |
request.post({ | |
uri: 'http://jol.jamaicaobserver.com/mogul_poll/add_vote.php?the_vote='+selection, | |
proxy: 'http://'+ line | |
}, function (err, resp, body) {}); | |
}); |
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 (Html.BeginForm()) | |
{ | |
<div id="RegBox" style="display: none;"> | |
@Html.LabelFor(m => Model.Name) | |
@Html.TextBoxFor(m => Model.Name) | |
@Html.ValidationMessageFor(m => m.Name) | |
</div> | |
<div id="LoginBox"> | |
@Html.LabelFor(m => Model.Email) |
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
<canvas id="MyCanvas" width="300" height="300"> | |
</canvas> | |
<img id="MyImg"/> | |
<script> | |
function drawAndConvertStuff(canvas) { | |
var canvasContext = canvas.getContext('2d'); | |
//draw a black box |
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 static int CountSorted<T>(this List<T> list, T item) where T : IComparable | |
{ | |
//find random index of the item | |
int index = list.BinarySearch(item); | |
//if item isn't found, just return -1 | |
if (index < 0) | |
return -1; | |
OlderNewer