Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Nilay Vishwakarma iwannabebot

🎯
Focusing
View GitHub Profile
View TestGist1.js
var gist = function(userName, gistId){
return 'https://gist.github.com/' + userName + '/' + gistId + '.js';
}
@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",
@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 / 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 / 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
Include the Material Lite JavaScript file in _Layout page of your application.
View UpdateLayout.cshtml
<script defer src="https://code.getmdl.io/1.1.1/material.min.js"></script>
@iwannabebot
iwannabebot / UpdateLayout.cshtml
Created Sep 10, 2018
Use our theme builder to decide some colour combinations. After deciding some arbitrary colour combination, you would be provided with a code to include in your layout page.
View UpdateLayout.cshtml
<link rel="stylesheet" href="https://code.getmdl.io/1.1.1/material.deep_purple-pink.min.css">
<link rel="stylesheet" href="http://cdn.wijmo.com/5.latest/styles/themes/material/wijmo.theme.material.deep_purple-pink.min.css" />
@iwannabebot
iwannabebot / UpdateLayout.cshtml
Created Sep 10, 2018
You can optionally include Material Icons in your application:
View UpdateLayout.cshtml
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
@iwannabebot
iwannabebot / UIHelper.cs
Created Oct 17, 2018
Search a WPF control hierarchy for controls that match a given name or type
View UIHelper.cs
/// <summary>
/// Finds a Child of a given item in the visual tree.
/// </summary>
/// <param name="parent">A direct parent of the queried item.</param>
/// <typeparam name="T">The type of the queried item.</typeparam>
/// <param name="childName">x:Name or Name of child. </param>
/// <returns>The first parent item that matches the submitted type parameter.
/// If not matching item can be found,
/// a null parent is being returned.</returns>
/// Usage:
View GcImagingOperations.cs
using System;
using System.IO;
using System.Drawing;
using GrapeCity.Documents.Drawing;
using GrapeCity.Documents.Text;
using GrapeCity.Documents.Imaging;
namespace GCImagingAWSLambdaS3
{
public class GcImagingOperations
{
You can’t perform that action at this time.