Skip to content

Instantly share code, notes, and snippets.

View qt-kaneko's full-sized avatar
🇺🇦

Kaneko Qt qt-kaneko

🇺🇦
View GitHub Profile
@qt-kaneko
qt-kaneko / Program.cs
Last active May 8, 2024 12:02
Google Lens API POC
using System;
using System.Linq;
using System.Net.Http;
using System.Text.Json;
using System.Text.RegularExpressions;
var http = new HttpClient();
// Here is image, i.e. File.ReadAllBytes("smth.png");
var file = new byte[] {137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 44, 0, 0, 0, 44, 8, 6, 0, 0, 0, 30, 132, 90, 1, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 11, 19, 0, 0, 11, 19, 1, 0, 154, 156, 24, 0, 0, 5, 194, 105, 84, 88, 116, 88, 77, 76, 58, 99, 111, 109, 46, 97, 100, 111, 98, 101, 46, 120, 109, 112, 0, 0, 0, 0, 0, 60, 63, 120, 112, 97, 99, 107, 101, 116, 32, 98, 101, 103, 105, 110, 61, 34, 239, 187, 191, 34, 32, 105, 100, 61, 34, 87, 53, 77, 48, 77, 112, 67, 101, 104, 105, 72, 122, 114, 101, 83, 122, 78, 84, 99, 122, 107, 99, 57, 100, 34, 63, 62, 32, 60, 120, 58, 120, 109, 112, 109, 101, 116, 97, 32, 120, 109, 108, 110, 115, 58, 120, 61, 34, 97, 100, 111, 98, 101, 58, 110, 115, 58, 109, 101, 116, 97, 47, 34, 32, 120, 58, 120, 109, 112, 116, 107, 61, 34, 65, 100, 111, 98, 101, 32, 88,
@qt-kaneko
qt-kaneko / StackAllocObject.cs
Created December 8, 2022 04:43
C# in stack object allocation
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
unsafe
{
var type = typeof(Test);
var typeHandle = type.TypeHandle.Value;
var size = Marshal.ReadInt32(typeHandle, 4);
var memory = stackalloc byte[size];
@qt-kaneko
qt-kaneko / Common Intermediate Language и системное программирование в Microsoft .NET.pdf
Last active July 29, 2022 20:33
Common Intermediate Language и системное программирование в Microsoft .NET
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.