Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Yoo justinyoo

View GitHub Profile
@gongdo
gongdo / JustSoStartup.cs
Last active Mar 1, 2016
JwtBearerAuthentication in ASP.NET5 RC1
View JustSoStartup.cs
//---------------------------------------------------------
// ...in the Startup.cs...
public void ConfigureServices(IServiceCollection services)
{
// ...
services.AddAuthentication();
services.AddAuthorization(options =>
{
var bearerPolicy = new AuthorizationPolicyBuilder()
.AddAuthenticationSchemes(JwtBearerDefaults.AuthenticationScheme)
@jlong
jlong / uri.js
Created Apr 20, 2012
URI Parsing with Javascript
View uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
You can’t perform that action at this time.