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 ApplicationSignInManager : SignInManager<ApplicationUser, string> | |
{ | |
public ApplicationSignInManager(ApplicationUserManager userManager, IAuthenticationManager authenticationManager) | |
: base(userManager, authenticationManager) | |
{ } | |
public override Task SignInAsync(ApplicationUser user, bool isPersistent, bool rememberBrowser) | |
{ | |
if (!user.EmailConfirmed) | |
{ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-1.9.1.js"></script> | |
<meta name="description" content="canvas.getContext() Sample"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> |
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
create proc Cleanup | |
as | |
declare @n char(1) | |
set @n = char(10) | |
declare @stmt nvarchar(max) | |
-- procedures |
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
$pkgver=$(Get-Date -Format 'yyyy.Mdd.Hmmss'); | |
Write-Host "##vso[task.setvariable variable=pkgver]$pkgver" |
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 DateTimeExtensions | |
{ | |
public static string ToFriendlyDate(this DateTime date) | |
{ | |
// Calculate the elapsed time | |
TimeSpan s = DateTime.UtcNow.Subtract(date); | |
// Get total number of days elapsed. | |
int dayDiff = (int)s.TotalDays; |
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
@model List<TwitterViewComponent.Tweet> | |
<h3>Recent Tweets</h3> | |
<ul> | |
@foreach (var tweet in Model) | |
{ | |
<li> | |
@tweet.Message<br/> | |
<a href="http://twitter.com/@tweet.Username/statuses/@tweet.Id">@(tweet.Timestamp)</a> | |
</li> |
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
@model List<TwitterViewComponent.Tweet> | |
<h3>Recent Tweets</h3> | |
<ul> | |
@foreach (var tweet in Model) | |
{ | |
<li> | |
@tweet.Message<br/> | |
<a href="http://twitter.com/@tweet.Username/statuses/@tweet.Id">@(tweet.Timestamp)</a> | |
</li> |
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
{ | |
"TwitterOptions": { | |
"Username": "jgaylord", | |
"ConsumerKey": "YOUR_KEY", | |
"ConsumerSecret": "YOUR_SECRET" | |
}, | |
"Logging": { | |
"LogLevel": { | |
"Default": "Warning" | |
} |
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
@page | |
@model IndexModel | |
@{ | |
ViewData["Title"] = "Home page"; | |
} | |
@await Component.InvokeAsync("RetrieveTweets", new { }) |
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 Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection.Extensions; | |
using TwitterViewComponent; | |
namespace Microsoft.Extensions.DependencyInjection | |
{ | |
public static class ServiceCollectionExtensions | |
{ | |
public static IServiceCollection AddTwitter(this IServiceCollection services, IConfiguration configuration = null) | |
{ |