Skip to content

Instantly share code, notes, and snippets.

View kant2002's full-sized avatar

Andrii Kurdiumov kant2002

View GitHub Profile
@kant2002
kant2002 / 00_Мавка.м
Last active April 1, 2023 21:16
Програми на Мавці
друк("Приклади програм на Мавці")
@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",
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 / 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)
@kant2002
kant2002 / Program.cs
Created July 7, 2023 12:31
translation
#line 1 "test.txt"
Console.WriteLine("hello world");
@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 / gpu.fsx
Created October 7, 2023 05:59
Trivial ILGPU sample
#r "nuget: ILGPU"
open ILGPU
open ILGPU.Runtime
let ShiftBy42 (index: Index1D) (buffer: ArrayView1D<int, Stride1D.Dense>) (constant: int) =
buffer.[index] <- int(index) + constant
// Create main context
use context = Context.CreateDefault()
@kant2002
kant2002 / Гакст.cs
Created October 25, 2023 15:27
Интерпретатор Гакст
using System.Diagnostics;
using System.Text;
var программа = $@"12>
{{
42+
|
56=
{{
3?
@kant2002
kant2002 / 6 - targets.csproj
Created January 19, 2024 16:54
What MSBuild do
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>_6___targets</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
@kant2002
kant2002 / митні_правила.fsx
Created February 28, 2024 15:05
Тестування на базі властивостей
#r "nuget: FsCheck, 3.0.0-rc2"
#r "nuget: FSharp.Core.Ukrainian, 0.0.6"
open FsCheck
open FsCheck.FSharp
type ТипПалива = Дизель | Бензін | Електрика | Гибрид | REXГибрид
type НапрямокПродаж = Казахстан | Киргизстан
type Авто = {
Паливо:ТипПалива