Skip to content

Instantly share code, notes, and snippets.

View uzbekdev1's full-sized avatar
🌴
On vacation

Elyor Latipov uzbekdev1

🌴
On vacation
View GitHub Profile
@uzbekdev1
uzbekdev1 / GlobalMiddleware.cs
Created October 6, 2025 09:47
authenticator validation
public class GlobalMiddleware
{
private readonly RequestDelegate _next;
public GlobalMiddleware(RequestDelegate next )
{
_next = next;
}
@uzbekdev1
uzbekdev1 / GlobalMiddleware.cs
Created October 6, 2025 09:37
request buffering
public class GlobalMiddleware
{
private readonly RequestDelegate _next;
private string _requestBody;
public GlobalMiddleware(RequestDelegate next)
{
_next = next;
@uzbekdev1
uzbekdev1 / ClientController.cs
Last active October 6, 2025 09:35
action attributes
[HttpGet]
[ProducesDefaultResponseType(typeof(ApiResponse<List<NotificationItem>>))]
public async Task<IActionResult> Notifications(){}
[HttpPost("{productId}")]
[ProducesDefaultResponseType(typeof(ApiResponse))]
public async Task<IActionResult> PostFeedback([FromRoute] long productId, [FromBody] ProductPostFeedback model){}
[HttpPost]
[ProducesDefaultResponseType(typeof(ApiResponse))]
@uzbekdev1
uzbekdev1 / ApiResponse.cs
Created October 6, 2025 09:30
api base response
public class ApiResponse<T>
{
public ApiResponse()
{
Success = true;
}
public ApiResponse(string error)
{
worker_processes auto;
events {
worker_connections 1024;
}
http {
@uzbekdev1
uzbekdev1 / .net conditions
Created July 31, 2025 08:44
fx level conditionns
#if NET8_0
// Code specific to .NET 8
#elif NET6_0
// Code specific to .NET 6
#else
// Default code for other versions
#endif
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
...
@uzbekdev1
uzbekdev1 / access.sql
Created March 11, 2025 19:57
Oracle create user with privileges
create user demo identified by 123456;
grant connect to demo;
grant connect to demo identified by 123456;
grant all privileges to demo identified by 123456;
@uzbekdev1
uzbekdev1 / Visual Studio 2022 Product Key
Created January 24, 2024 12:24
Visual Studio 2022 Enterprise Product key
Visual Studio 2022
Enterprise :
VHF9H-NXBBB-638P6-6JHCY-88JWH
Professional:
TD244-P4NB7-YQ6XK-Y8MMM-YWV2J
@uzbekdev1
uzbekdev1 / terminate.cs
Created December 18, 2023 04:59 — forked from jvshahid/terminate.cs
C# terminating a child process (as opposed to killing, i.e. sigkill vs. sigint on linux)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace TestCtrlEvent
@uzbekdev1
uzbekdev1 / read-emails-from-shared-mailbox.cs
Created December 12, 2023 23:24 — forked from aspose-com-gists/read-emails-from-shared-mailbox.cs
Read Emails from Shared Mailbox on Exchange Server in C# .NET
const string mailboxUri = "<HOST>";
const string domain = "";
const string username = "<EMAIL ADDRESS>";
const string password = "<PASSWORD>";
const string sharedEmail = "<SHARED EMAIL ADDRESS>";
// Setup credentials
NetworkCredential credentials = new NetworkCredential(username, password, domain);
// Connect to server