Skip to content

Instantly share code, notes, and snippets.

View kant2002's full-sized avatar

Andrii Kurdiumov kant2002

View GitHub Profile
@kant2002
kant2002 / sqlparser.fsx
Last active September 29, 2023 11:19
Simple SQL Parser
#r "nuget: fparsec"
open FParsec
let test p str =
match run p str with
| Success(result, _, _) ->
printfn "Success: %A" result
| Failure(errorMsg, _, _) -> printfn "Failure: %s" errorMsg
let ws = spaces
@kant2002
kant2002 / Program.cs
Created July 7, 2023 12:31
translation
#line 1 "test.txt"
Console.WriteLine("hello world");
@kant2002
kant2002 / Program.fs
Last active June 23, 2023 13:47
CNCF claim check
open Octokit
open LibGit2Sharp
open System.IO
open System.Linq
let github_token = "changeme"
let rec queryRepos (github:GitHubClient) page items =
task {
let searchRequest = SearchRepositoriesRequest(Topic = "cncf", Page = page, SortField = RepoSearchSort.Stars)
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
internal class FromFolderDelegatingHandler : DelegatingHandler
{
@kant2002
kant2002 / prompt.md
Created April 2, 2023 18:45
ChatGPT refactoring

Me:

Please convert javascript array to javascript object where each item will correspont to object property 
and that property has same value as an item. Array to convert: 
const KEYWORDS = [
        "abstract",
        "and",
        "as",
        "assert",
        "base",
@kant2002
kant2002 / 00_Мавка.м
Last active April 1, 2023 21:16
Програми на Мавці
друк("Приклади програм на Мавці")
@kant2002
kant2002 / Program.csproj
Created November 16, 2022 05:06 — forked from seclerp/Program.csrpoj
Solution for the task "Run the Java Hello World example via both dotnet run and javac"
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.java" />
</ItemGroup>
@kant2002
kant2002 / AvaloniaHeadlessConsoleApp.csproj
Last active November 6, 2022 14:54
Headless Avalonia
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
@kant2002
kant2002 / program.cs
Created September 12, 2022 15:02
Funny lock
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
test x = new test();
for(var i =0; i < 10; i++)
{
var thread = new Thread(Worker);
thread.Start();
}
@kant2002
kant2002 / Program.cs
Created August 31, 2022 19:53
Windows Forms NativeAOT
Application.Run(new Form() { Text = "Hello NativeAOT!" });