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 / deep_research.rb
Created February 16, 2025 20:58 — forked from schappim/deep_research.rb
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'

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 / attiny_13_water_detector_sleep_mode.md
Last active February 5, 2025 21:40
attiny13 water detector sleep mode
#include <avr/interrupt.h>
#include <avr/io.h>
#include <util/delay.h>


#define F_CPU 128000UL
#define ledPin PB2

volatile bool inSleep = false;
@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
@gorshkov-leonid
gorshkov-leonid / Recipe-bundling-fonts-with-headless-chrome.md
Created February 19, 2023 15:20 — forked from nmqanh/Recipe-bundling-fonts-with-headless-chrome.md
How to build a fontconfig bundle for adding arbitrary fonts to headless chrome independent of the OS. This is specifically useful for deploying headless chrome to AWS lambda where it is necessary to include fonts for rendering CJK (Chinese, Japanese, Korean) characters into the deployed bundle.

Building fontconfig

Start up a lambda-like docker container:

docker run -i -t -v /tmp:/var/task lambci/lambda:build /bin/bash

Install some dependencies inside the container:

yum install gperf freetype-devel libxml2-devel git libtool -y

easy_install pip

@gorshkov-leonid
gorshkov-leonid / avoid-npm-vunarabilities.md
Last active March 18, 2022 12:20
Avoid NPM vulnarabilities
    1. Rmove all ~, ^ from versions in package.json
    2. Create initial package.lock
  1. Create /Users/<user-name>/.npmrc or %USERPROFILE%\.npmrc or here echo $(npm config ls -l)
  2. Fill .npmrc with this content
     @netcracker:registry=https://corp-npm-server.com/path-to-internal-packages/
     registry=https://corp-npm-server.com/path-to-external-packages/
    
  3. Command
@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/.
@gorshkov-leonid
gorshkov-leonid / install-applications.md
Last active December 13, 2024 10:38
Install applications