Skip to content

Instantly share code, notes, and snippets.

View igor-ramazanov's full-sized avatar

Igor Ramazanov igor-ramazanov

View GitHub Profile
@igor-ramazanov
igor-ramazanov / Keccak256.scala
Last active October 5, 2025 23:01
Pure Scala Keccak-256 hashing function implementation
object Keccak256:
def hash(data: Array[Byte]): Array[Byte] = new Keccak256().hash(data)
private class Keccak256 private (
private val state: Array[Long] = Array.fill[Long](25)(0L),
private val dataQueue: Array[Byte] = Array.fill[Byte](192)(0),
private var bitsInQueue: Int = 0,
):
@igor-ramazanov
igor-ramazanov / bloop-completions.nu
Last active September 9, 2025 16:23
Bloop + Nushell + ScalaCLI
def projects []: nothing -> table<value: string> {
bloop autocomplete --format fish --mode projects e> /dev/null
| lines
| wrap value
}
def commands []: nothing -> table<value: string> {
bloop autocomplete --format fish --mode commands e> /dev/null
| lines
| wrap value
@igor-ramazanov
igor-ramazanov / completions.nu
Created September 2, 2025 13:39
An example of reusing Fish completions in Nushell
use bloop.nu
use coursier.nu
use scala-cli.nu
use scalafix.nu
export-env {
if (not ($env.__completers_loaded? | default false)) {
$env.__completers_loaded = true
let fish_completer = {|spans|
@igor-ramazanov
igor-ramazanov / Scotty.hs
Last active September 2, 2025 13:41
Self-contained Haskell scripts with Nix optionally compiled as a static binary (using nix bundlers)
#!./haskell.nu --compiler ghc984 --deps [base scotty] --task bundle --debug
{-# LANGUAGE OverloadedStrings #-}
import Web.Scotty
import Data.Monoid (mconcat)
main = scotty 3000 $ do
get "/:word" $ do
beam <- param "word"
@igor-ramazanov
igor-ramazanov / nspawn.nu
Created May 6, 2025 13:13
A Nushell script to run systemd-nspawn containers from Docker images
#!/usr/bin/env -S nu --login --interactive
export def main [
image: string
] {
let name = $image | split row ':' | first
mkdir $name
cd $name
docker pull $image
let id = docker create --name $name $image true
rating ratings_num title
5 1 Data Observability for Data Engineering: Proactive strategies for ensuring data accuracy and addressing broken data pipelines
4.57 7 Driving Data Quality with Data Contracts: A comprehensive guide to building reliable, trusted, and effective data platforms
4.48 40 Learning eBPF: Programming the Linux Kernel for Enhanced Observability, Networking, and Security
4.41 177 Better Data Visualizations: A Guide for Scholars, Researchers, and Wonks
4.39 7582 Storytelling with Data: A Data Visualization Guide for Business Professionals
4.36 382 The Site Reliability Workbook: Practical Ways to Implement SRE
4.26 407 Truthful Art, The: Data, Charts, and Maps for Communication (Voices That Matter)
4.22 9 Learning OpenTelemetry: Setting Up and Operating a Modern Observability System
provide-module -override files %{
declare-user-mode files
# Search by filename
define-command -hidden tmux-pick-file %{ nop %sh{
program="
let picked = fd --type=file | fzf --preview 'bat --color=always --plain --line-range=:50 {}' --preview-window wrap,noinfo;
$'eval -client $kak_client edit (\$picked)' | kak -p $kak_session;
"
@igor-ramazanov
igor-ramazanov / lsp.kak
Last active March 13, 2024 15:19
kakoune-lsp config, save it as `~/.config/kak/autoload/lsp.kak`
eval %sh{kak-lsp/target/release/kak-lsp --kakoune --session $kak_session}
hook global WinSetOption filetype=(scala|java|nix|rust|smithy|terraform|c|python|nu|unison|cpp) %{
lsp-enable-window
# Show signature in the insert mode.
lsp-auto-signature-help-enable
# Indent guides
# WIP: https://github.com/kakoune-lsp/kakoune-lsp/pull/720
@igor-ramazanov
igor-ramazanov / tmux-formats-cheatsheet.md
Created October 27, 2023 10:26
Tmux FORMATs cheatsheet

Tmux cheatsheet

Conditionals

? - Conditionals, if a variable exists and non-zero, then the first is chosen, otherwise second.
Example: #{?session_attached,attached,not attached}.

Comparisons

==:, !=:, &lt;:, &gt;:, &lt;=:, &gt;=: - String comparisons.\

//> using scala 3.3.1
//> using options -Wnonunit-statement, -Wunused:all, -Wvalue-discard, -Yno-experimental, -Ysafe-init, -deprecation, -feature, -new-syntax, -unchecked,
//> using platform native
//> using nativeGc none
//> using nativeLto thin
//> using nativeMode release-full
//> using nativeEmbedResources false