Skip to content

Instantly share code, notes, and snippets.

View unseensenpai's full-sized avatar
😋
Keep Improving

Said Gülmez unseensenpai

😋
Keep Improving
View GitHub Profile
@unseensenpai
unseensenpai / .gitlab-ci.yml
Created November 22, 2024 08:05
Sonarcube Setup for Gitlab CI
sonarqube-check:
image: mcr.microsoft.com/dotnet/core/sdk:latest
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
@unseensenpai
unseensenpai / Dumper.cs
Created August 29, 2024 11:41
WIA Device and Item Properties Dumper
namespace Dumper;
public class Dumper{
private static void LogAllProperties(Item item, Device device)
{
LogDeviceProperties(device);
LogItemProperties(item);
}
@unseensenpai
unseensenpai / WIAHelper.cs
Created August 29, 2024 09:45
WIA Device No Finder (TWAIN SOURCE)
namespace WIAHelper;
public class WIAHelper
{
readonly DeviceManager _deviceManager;
public WIAHelper()
{
_deviceManager = new DeviceManager();
}
@unseensenpai
unseensenpai / MapperBuilderExtensions.cs
Created March 28, 2024 11:44
Automapper Registration Extension
using AutoMapper;
using System.Reflection;
namespace Microsoft.Extensions.DependencyInjection
{
public static class MapperBuilderExtensions
{
public static IServiceCollection AddAutoMapperModule<T>(this IServiceCollection services) where T : Profile
{
List<Type> profiles = [];
@unseensenpai
unseensenpai / BaseAuditableDataObject.cs
Last active March 22, 2024 11:39
DevExpress XPO v23.2.6 Migrate Database - Create Scheme in .Net 6/7/8/9
[Persistent(nameof(BaseAuditableDataObject))]
public abstract class BaseAuditableDataObject : BaseDataObject
{
public BaseAuditableDataObject()
{
}
public BaseAuditableDataObject(Session session) : base(session)
{
}
@unseensenpai
unseensenpai / App.config
Last active November 22, 2024 08:09
How To Register App.Config and appsettings.json -> Config Manager for .Net 6+ and ASP.NET Core 6+
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="Bla:Foo:Zoo" value="SampleValue" />
</appSettings>
</configuration>
@unseensenpai
unseensenpai / Extensions.cs
Last active January 24, 2024 08:14
DevExpress GridView GetSelectedSurrogates Extension
/// <summary>
/// It is the method that returns the selected data in generic type
/// using the repository view in all Devexpress components that can make selections.
/// </summary>
/// <typeparam name="T">Surrogate Type</typeparam>
/// <param name="gridView">Repository view on component</param>
/// <returns></returns>
public static IEnumerable<T> GetSelectedSurrogates<T>(this GridView gridView) where T : class
{
if (gridView.SelectedRowsCount > 0)
@unseensenpai
unseensenpai / windows10-11-v21.6.0-nodejs-npm.txt
Last active January 17, 2024 10:18
npm MODULE_NOT_FOUND error windows 10/11
https://nodejs.org/dist/v21.6.0/node-v21.6.0-x64.msi
Just copy
C:\Program Files\nodejs -> node_modules folder
to
%APPDATA%\npm ? if not exist just create dir then copy.
@unseensenpai
unseensenpai / DependencyInjectionResolver.cs
Created September 21, 2023 07:01
DevExpress WinForm DI/IoC Sample
using IoC.DI.WinForm.Sample.Configuration;
namespace Microsoft.Extensions.DependencyInjection
{
public static class DependencyInjectionResolver
{
public static IServiceCollection AddServiceModules(this IServiceCollection services) =>
services
.AddFormModule()
.AddEmployeeModule()
@unseensenpai
unseensenpai / Program.cs
Last active May 3, 2024 12:48
Request Response Logging Middleware in .Net 8
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
WebApplication app = builder.Build();
app.UseRequestResponseLogging();
app.Run();