Skip to content

Instantly share code, notes, and snippets.

View abhishekbhalani's full-sized avatar
🎄
working on latest framework...

Abhishek B. abhishekbhalani

🎄
working on latest framework...
View GitHub Profile
@topalex
topalex / mime.html
Last active December 26, 2024 09:56
How to check real mime type of image in javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mime type checker</title>
<script type="text/javascript" src="/jquery.min.js"></script>
<script>
$(function () {
var result = $('div#result');
if (window.FileReader && window.Blob) {
@miloszpp
miloszpp / RunOpenCover.ps1
Created October 6, 2017 13:54
PowerShell script to generate coverage reports using OpenCover
Param(
[string]$sourcesDirectory, #the root of your project
[string]$testAssembly, #the file pattern describing test assemblies to look for
[string]$testFiltercriteria="", #test filter criteria (as in Run Visual Studio Tests task)
[string]$openCoverFilters="+[*]*" #OpenCover-specific filters
)
. $PSScriptRoot\vsts-task-lib\LongPathFunctions.ps1
. $PSScriptRoot\vsts-task-lib\TraceFunctions.ps1
. $PSScriptRoot\vsts-task-lib\LegacyFindFunctions.ps1
public class StringContentRazorProject : RazorLightProject
{
public StringContentRazorProject(Func<string, Stream> getContentFunc, Func<string, bool> existsCheckFunc)
{
this.GetContentFunc = getContentFunc;
this.ExistsCheckFunc = existsCheckFunc;
}
public Func<string, Stream> GetContentFunc { get; }
public Func<string, bool> ExistsCheckFunc { get; }
@ismcagdas
ismcagdas / MyAppSession.cs
Last active April 27, 2021 13:18
How to add custom field to AbpSession in ASP.NET Core
//Define your own session and add your custom field to it
//Then, you can inject MyAppSession and use it's new property in your project.
public class MyAppSession : ClaimsAbpSession, ITransientDependency
{
public MyAppSession(
IPrincipalAccessor principalAccessor,
IMultiTenancyConfig multiTenancy,
ITenantResolver tenantResolver,
IAmbientScopeProvider<SessionOverride> sessionOverrideScopeProvider) :
base(principalAccessor, multiTenancy, tenantResolver, sessionOverrideScopeProvider)
@helderboone
helderboone / Context.cs
Last active January 6, 2022 21:41
MongoDb settings for asp.net core
public class NoteContext
{
private readonly IMongoDatabase _database = null;
public NoteContext(IOptions<Settings> settings)
{
var client = new MongoClient(settings.Value.ConnectionString);
if (client != null)
@arcadiogarcia
arcadiogarcia / Web.config
Created June 28, 2017 11:35
Web.config for allowing .json files in IIS (for Azure Web Apps)
<?xml version="1.0"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
</configuration>
Name: Flash
Serial: eNrzzU/OLi0odswsqnHLSSzOqDGoca7JKCkpsNLXLy8v1ytJTczVLUotKNFLzs8FAJHYETc=
if anyone wants to thank ETH: 0x527c2aB55b744D6167dc981576318af96ed26676
Thank you!
@jbritton
jbritton / graphql-cheat-sheet.md
Last active September 24, 2024 21:25
GraphQL Cheat Sheet

GraphQL Cheat Sheet

Overview

  • An alternative approach to RESTful APIs
  • Clients issue queries/mutations to read and update data
  • Clients can fetch only the entity fields that are required
  • GraphQL query syntax can express complex entity relations => nested objects
  • Mitigates the explosion of RESTful endpoints in scenarios where many different representations of an entity are needed
  • Graphiql is a query execution UI, also provides good documentation
@sohan5005
sohan5005 / markup.html
Created January 30, 2017 06:47
Easy setup for shuffle.js with filter system
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Shuffle.js</title>
<style>
body {
max-width: 1170px;
margin: auto;
}
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.IdentityModel.Tokens;
namespace Blog.TokenAuthGettingStarted
{
public partial class Startup