Skip to content

Instantly share code, notes, and snippets.

View gorshkov-leonid's full-sized avatar

Leonid Gorshkov gorshkov-leonid

View GitHub Profile
@gorshkov-leonid
gorshkov-leonid / update-file-permissions-in-git-repo.md
Created August 11, 2021 12:38
Update file permissions in GIT repo
find . -name "*.sh" -exec git ls-files -s {} \;
find . -name "*.sh" -exec git update-index --chmod=+x {} \;
@gorshkov-leonid
gorshkov-leonid / install-and-configure-ubuntu-wsl.md
Last active December 13, 2024 10:37
Install and configure Ubuntu WSL
@gorshkov-leonid
gorshkov-leonid / docker-in-windows.md
Last active April 2, 2025 10:16
Docker In Windows (Final)

See final versions without trash here

Docker in Windows without Docker Desktop

❤️‍🔥 Install docker client in Windows

  • Download necessary version of docker binaries from https://docs.docker.com/engine/install/binaries/ and extract archive to c:/Program Files, for example, using script in powershell. Run powershell as Administrator and call:
    Expand-Archive .\docker-20.10.9.zip -DestianationPath $Env:ProgramFiles  
    Files docker.exe and dockerd.exe will be here c:/Program Files/docker/.
type AnyFunction = (...args: any[]) => any
function useEvent<T extends AnyFunction>(callback?: T) {
const ref = useRef<AnyFunction | undefined>(() => {
throw new Error("Cannot call an event handler while rendering.")
})
// Or useInsertionEffect if it's React 18
useLayoutEffect(() => {
ref.current = callback
})

Types

  • feat Commits, that adds or remove a new feature
  • fix Commits, that fixes a bug
  • refactor Commits, that rewrite/restructure your code, however does not change any API behaviour
  • perf Commits are special refactor commits, that improve performance
  • style Commits, that do not affect the meaning (white-space, formatting, missing semi-colons, etc)
  • test Commits, that add missing tests or correcting existing tests
  • docs Commits, that affect documentation only
  • build Commits, that affect build components like build tool, ci pipeline, dependencies, project version, ...
  • ops Commits, that affect operational components like infrastructure, deployment, backup, recovery, ...
@gorshkov-leonid
gorshkov-leonid / OpenAIRealtimeWebSocket.kt
Created November 19, 2024 06:28 — forked from paulotaylor/OpenAIRealtimeWebSocket.kt
Simple Kotlin OpenAI Websocket implementation of the Realtime API
import android.util.Log
import io.ktor.util.decodeBase64Bytes
import io.ktor.util.encodeBase64
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import okhttp3.WebSocket
import okhttp3.WebSocketListener
import okio.ByteString
import org.json.JSONArray
@schappim
schappim / deep_research.rb
Created February 9, 2025 09:39
A recreation of OpenAI's Deep Research feature in Ruby
#!/usr/bin/env ruby
# deep_research.rb
require 'openai'
require 'json'
require 'net/http'
require 'uri'
require 'timeout'
require 'time'