This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
OBJECT_NAME(i.object_id) AS TableName, | |
i.name AS IndexName, | |
i.index_id, | |
i.type_desc, | |
i.is_unique, | |
i.is_primary_key, | |
i.is_disabled | |
FROM | |
sys.indexes i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string GetDifference(string baseString, string comparedString) | |
{ | |
if (baseString == null || comparedString == null) | |
throw new ArgumentNullException("Input strings cannot be null."); | |
if (comparedString.StartsWith(baseString)) | |
{ | |
// Jeśli comparedString zaczyna się od baseString, zwróć różnicę | |
return comparedString.Substring(baseString.Length); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IWorkflowStep | |
{ | |
string Name { get; } | |
Task<WorkflowResult> ExecuteAsync(WorkflowContext context); | |
} | |
public class WorkflowResult | |
{ | |
public bool Success { get; set; } | |
public string? Message { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tworzenie wyrażenia "x => x.Property != null && x.Property.Contains(value)" | |
var parameter = propertyExpression.Parameters[0]; // Pobierz parametr lambda z propertyExpression (np. x) | |
var property = propertyExpression.Body; // Pobierz ciało wyrażenia (np. x.Property) | |
// Utwórz wyrażenie "x.Property != null" | |
var notNullExpression = Expression.NotEqual(property, Expression.Constant(null, typeof(string))); | |
// Wyszukaj metodę "Contains" na typie string | |
var containsMethod = typeof(string).GetMethod(nameof(string.Contains), new[] { typeof(string) }); | |
if (containsMethod == null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<TargetFramework>netstandard2.0</TargetFramework> | |
<IncludeBuildOutput>false</IncludeBuildOutput> | |
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | |
<PackageId>MyAnalyzerPackage</PackageId> | |
<PackageVersion>1.0.0</PackageVersion> | |
<Authors>Your Name</Authors> | |
<Company>Your Company</Company> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Wyświetlenie różnic między dwoma tabelami | |
SELECT | |
'TABELA_1 -> TABELA_2' AS RÓŻNICA, | |
t1.* | |
FROM | |
TABELA_1 t1 | |
LEFT JOIN | |
TABELA_2 t2 | |
ON | |
t1.id = t2.id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="pl"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Dynamiczny Diagram Mermaid</title> | |
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script> | |
<style> | |
#mermaid { | |
border: 1px solid black; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq.Expressions; | |
/// <summary> | |
/// Returns the name of the specified property of the specified type. | |
/// </summary> | |
/// <typeparam name="T">The type the property is a member of.</typeparam> | |
/// <param name="property">The property expression.</param> | |
/// <returns>The property name.</returns> | |
public static string GetPropertyName<T>(Expression<Func<T, object>> property) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
// from comment discussion http://stackoverflow.com/questions/671968/retrieving-property-name-from-lambda-expression/17220748#17220748 | |
Expression<Func<O, int>> exprId = o => o.Id; | |
Expression<Func<O, string>> exprName = o => o.Name; | |
Expression<Func<O, int[]>> exprItems = o => o.Items; | |
Expression<Func<O, int>> exprItemsLength = o => o.Items.Length; | |
Expression<Func<O, Subclass>> exprChild = o => o.Child; | |
Expression<Func<O, string>> exprChildName = o => o.Child.Name; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name 52.xx.xxx.xx; | |
location / { | |
proxy_set_header X-Forwarded-For $remote_addr; | |
proxy_set_header Host $http_host; | |
proxy_pass "http://127.0.0.1:4200"; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; |
NewerOlder