Skip to content

Instantly share code, notes, and snippets.

View nfedyashev's full-sized avatar

Nikita Fedyashev nfedyashev

View GitHub Profile
nfedyashev / find_relevant_chunk.txt
Created April 21, 2024 11:26
agentic chunker prompts
Determine whether or not the "Proposition" should belong to any of the existing chunks.
A proposition should belong to a chunk of their meaning, direction, or intention are similar.
The goal is to group similar propositions and chunks.
If you think a proposition should be joined with a chunk, return the chunk id.
If you do not think an item should be joined with an existing chunk, just return "No chunks"
nfedyashev /
Created March 9, 2023 19:37
Using expect to drive netcat - Simply piping the required sequence of commands into netcat is unlikely to work because the SMTP commands and responses would not be properly interleaved. If you want to use the method above from a script then you will need to make use of a program such as expect. Here is an example:
set timeout 30
proc abort {} { exit 2 }
spawn nc -C 25
expect default abort "220 "
send "HELO\r"
expect default abort "\n250 "
send "MAIL\r"
nfedyashev / config
Created July 22, 2021 13:12
i3blocks - ruby json output command
# [ib]
# command=/home/nikita/.rbenv/shims/ruby /home/nikita/Projects/nikita-dotfiles/bin/ibb
# interval=10
# format=json
# frozen_string_literal: true
require "bundler/setup"
require_relative "../lib/ibb
require 'json'
nfedyashev / config
Created July 22, 2021 13:09
i3blocks - clickable command counter
full_text=Click me!
command=ruby -r json -n -e '$_ = JSON.parse($_)' -e '$_["full_text"] = "Click %s at (%d,%d)" % $_.slice("button", "x", "y").values' -e 'puts JSON.dump($_)' -e 'STDOUT.flush'
nfedyashev /
Created February 15, 2021 22:29 — forked from abrochard/
Notes from the "Conquering Kubernetes with Emacs" presentation

Conquering Kubernetes with Emacs

Specific Annoying workflow

Listing pods with kubectl get pods, then select a pod name and copy paste it into kubectl logs [pod name]


  • I want to streamline my workflow and stop using the terminal
  • learn more about kubernetes
  • main kubernetes extension for Emacs out there is greedy for permissions
// custom error handling logic
const retryThreeTimes = obs =>
obs.retry(3).catch(_ => Rx.Observable.of('ERROR!'));
const examplePromise = val =>
new Promise(resolve => resolve(`Complete: ${val}`));
//faking request
const subscribe = Rx.Observable.of('some_url')
.mergeMap(url => examplePromise(url))
// could reuse error handling logic in multiple places with let
The simplest implementation might look like this:
<!-- language: lang-ruby -->
class ArrayUtils
def self.multiplos(num, step)
step.step(num * step, step).to_a

The simplest implementation might look like this:

class ArrayUtils def self.multiplos(num, step) step.step(num * step, step).to_a end end

;; (server-start)
emacsclient --eval '(with-current-buffer "*scratch*" (insert "do you see me?"))'
(ns clara.compatibility
(:require [clara.rules.accumulators :as acc]
[ :as tracing]
[clara.rules :refer :all]))
(defrecord Compatible [items])
(defrecord Incompatible [items])
(defrecord Protein [])