Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Nilay Vishwakarma iwannabebot

🎯
Focusing
View GitHub Profile
@iwannabebot
iwannabebot / materialformat.txt
Last active Sep 10, 2018
Material themes are written in a specific format to allow several combinations of primary/accent colours
View materialformat.txt
material[.{{primary_colour}}-{{secondary_colour}}]
example:
material
material.indigo-pink
material.green-red
@iwannabebot
iwannabebot / UpdateLayout.cshtml
Created Sep 10, 2018
To apply material theme in your application, you need to add the following code in _Layout.cshtml
View UpdateLayout.cshtml
// If using tag helpers
<c1-styles theme="material" />
// If using html helpers
@Html.C1().Styles().Theme("material")
@iwannabebot
iwannabebot / SwaggerUIOAuth2HeaderStartup.cs
Last active May 13, 2018
Add Bearer token in header of a Swagger request
View SwaggerUIOAuth2HeaderStartup.cs
public void ConfigureServices(IServiceCollection services)
{
services
.AddSwaggerGen(c =>
{
c.OperationFilter<AddAuthorizationHeaderParameterOperationFilter>();
});
}
/// <summary>
@iwannabebot
iwannabebot / SwaggerUIOAuth2MiddlewarwStartup.cs
Last active May 13, 2018
Add OAuth2/OpenID compatible middleware to Swagger
View SwaggerUIOAuth2MiddlewarwStartup.cs
public void ConfigureServices(IServiceCollection services)
{
// Other settings
services
.AddSwaggerGen(c =>
{
// Other settings
c.AddSecurityDefinition("oauth2", new OAuth2Scheme
{
Type = "oauth2",
View TestGist1.js
var gist = function(userName, gistId){
return 'https://gist.github.com/' + userName + '/' + gistId + '.js';
}