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
@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)
@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)
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; }
@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
@topalex
topalex / mime.html
Last active May 17, 2025 22:52
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) {
NetLimiter 3
Registration name: Peter Raheli
Registration code: C99A2-QSSUD-2CSBG-TSRPN-A2BEB
NetLimiter 4
Registration Name: Vladimir Putin #2
Registration Code: XLEVD-PNASB-6A3BD-Z72GJ-SPAH7
https://www.netlimiter.com/download
# Netlimiter Full Netlimiter Activated Netlimiter cracked Netlimiter Full Version Netlimiter Serial Netlimiter keygen Netlimiter crack Netlimiter 4 serial Netlimiter 4 Crack Netlimiter 4 register Netlimiter 4 patch Netlimiter full Full version Netlimiter 4 Activated Netlimiter 4 Cracked Netlimiter Pro
@yorek
yorek / OAuth2Middleware.cs
Last active December 14, 2021 05:50
ASP.NET Core 2 Custom OAuth2 Authentication
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.OAuth;
using Newtonsoft.Json.Linq;
@sitefinitySDK
sitefinitySDK / CommandLineArguments.txt
Created December 23, 2017 17:56
SF_10.1, SF_10.2, SF_11.0, SF_11.1, SF_11.2, SF_12.0, SF_12.1, SF_12.2, SF_13.0, SF_13.1, SF_13.2, SF_13.3, SF_14.0, SF_14.1, SF_14.2, SF_14.3 - https://docs.sitefinity.com/reference-command-line-arguments
Telerik.Sitefinity.Compiler.exe /url="http://localhost:8080" /appdir="D:\Projects\SitefinityWebApp" /username="sfadmin" /password="admin@2" /strategy="Frontend" /membershipprovider="Default"
@digitaldelirium
digitaldelirium / Program.cs
Created February 9, 2018 04:41
PKCS12/PFX certificate not presenting private key?
using System;
using Microsoft.AspNetCore.Hosting;
using MacsASPNETCore;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Net.Mime;
using System.Reflection;
using System.Security;
using System.Security.Cryptography;
@michielmulders
michielmulders / random.sol
Created May 24, 2018 08:49
Simple random number generation Ethereum smart contract Solidity
function random() private view returns (uint8) {
return uint8(uint256(keccak256(block.timestamp, block.difficulty))%251);
}