Skip to content

Instantly share code, notes, and snippets.

View nenkoru's full-sized avatar

Ruslan Chernenko nenkoru

View GitHub Profile
sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAID68LTj/vRUEwKCK8hn28LIqGEeAwIKrJj8T8+M+HbHLAAAABHNzaDo= cernenkoruslan@Cernenkos-MacBook-Pro.local
@startuml
!theme materia-outline
set separator none
top to bottom direction
actor User
package Internet {
node "User's Laptop" as laptop {
component "Ziti Desktop Agent" as ziti_desktop_agent
version: '3.8'
services:
registry-ui:
image: joxit/docker-registry-ui:main
restart: always
ports:
- 80:80
environment:
- SINGLE_REGISTRY=true
@nenkoru
nenkoru / article.md
Created December 12, 2023 07:28
How to share a MacOS screen to any device with Retina quality and low-latency

How to share a screen in MacOS to any device with Retina quality and low-latency.

Embarking on a quest for seamless MacBook-to-Android tablet screen sharing, I quickly discovered that existing solutions, like the clunky Duet, left much to be desired. Undeterred, I delved into the realm of browser-based screen sharing, realizing that our ubiquitous browsers might just hold the key to a smoother experience.

My exploration led me to the fascinating world of WebRTC, a technology weaving its magic across the internet and, importantly, in screen-sharing solutions. What caught my attention was not just its capability to facilitate screen sharing but the added perk of peer-to-peer connectivity, bypassing the need for intermediary servers. Imagine sharing your screen without the fuss of servers – WebRTC promised just that.

As I scoured various projects enabling browser-based screen sharing, I stumbled upon Spreen, a nifty JS project. Spreen seamlessly integrates a server-side JS code that acts as a messenger, facil

@nenkoru
nenkoru / pbi.py
Last active April 2, 2024 12:11
Connect to PowerBI OLAP from Python cross-platform using dotnet
"""
My journey started after reading this topic. And I started to gather all the breadcrumbs and clues I have found around the Internet.
First of all. There is a difference between Mono and dotnet(aka .net core), as pointed by Darren Gosbell on a microsoft learn page [4].
As everyone stumbling upon this issue I tried using Mono and specific to Windows version of Adomd whic is located in this link [5]. It didn't work as there were API used specific to Windows. It was failing.
Then I learned that there is actualy a 'native' dotnet app that could run those DLLs.
I started by loading that native to Windows AdomdClient DLL version using Mono - Fail.
Then using dotnet - Fail.
And right after that I understood that a .net core DLL has to be used. So I found one on Nuget [3].
And boom, right after that the original problem has gone, but I had a malformed connection string, which I believe was leading to lib to try to run a interactive login(just imo) and then failing into an issue where it said that a function or a
@nenkoru
nenkoru / hfcc_poc.py
Created August 7, 2023 20:46
An example of simple language server using pygls
#!/usr/bin/python3
from pygls.server import LanguageServer
from lsprotocol.types import (
TEXT_DOCUMENT_COMPLETION,
CompletionItemKind,
CompletionItem,
CompletionList,
CompletionParams,
)
@nenkoru
nenkoru / main.py
Created August 1, 2023 19:36
A showcase of embedding of an external file into the prompt for hfcc.nvim
# Current path: test/main.py
#
# Included snippet from test/utils/timezone.py:
# from datetime import datetime, timezone, tzinfo
#
#
# def datetime_exists(dt):
# """Check if a datetime exists. Taken from: https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html"""
# # There are no non-existent times in UTC, and comparisons between
# # aware time zones always compare absolute times; if a datetime is
@nenkoru
nenkoru / starcoder.py
Created July 16, 2023 12:02
Starcoder for lmi
from typing import Union, Iterable, List
from collections.abc import Iterable as abc_Iterable
import transformers
import ctranslate2
class CT2Generator:
"""Implements LMIProtocol."""
@nenkoru
nenkoru / parse.js
Created June 24, 2023 20:44
Parse games compatibility from yuzu
let xhr = new XMLHttpRequest();
xhr.open("GET", "https://yuzu-emu.org/game/", false)
xhr.send()
parser = new DOMParser();
yuzuDocument = parser.parseFromString(xhr.response, 'text/html');
function extractInnerTextFromNodes(nodes, childElement) {
var texts = []
for(var i = 0; i < nodes.length - 1; i++) {