Skip to content

Instantly share code, notes, and snippets.

View Masynchin's full-sized avatar

Max Smirnov Masynchin

View GitHub Profile
@kubukoz
kubukoz / main.scala
Last active October 1, 2025 14:43
http4s + scalatags + htmx + fs2/SSE
//> using scala 3.7
//> using dep org.http4s::http4s-ember-server:0.23.30
//> using dep org.http4s::http4s-dsl:0.23.30
//> using dep org.http4s::http4s-scalatags::0.25.2
//> using option -Wunused:all
import scalatags.Text.all.*
import cats.effect.*
import fs2.Stream
import org.http4s.*
import org.http4s.dsl.io.*
@grdscrc
grdscrc / jazz.sh
Last active March 23, 2025 23:35
jazz : list paths from a json input, fuzzy search a node, get its content ; useful with large payloads
#!/usr/bin/env bash
# Tested with jq 1.6 & fzf 0.42.0
# Inspired by https://github.com/reegnz/jq-zsh-plugin
# Call with `jazz <big_file_with_many_paths>.json` or `<command producing a valid json> | jazz`
# End command with `... | pbcopy` or `... > output.json` to save selection
input=$1
TMP_DIR=$(mktemp -d /tmp/jazz_XXX)
chmod 700 "$TMP_DIR"
@lbialy
lbialy / ai.scala
Last active January 3, 2025 01:43
I heard you like chatting with ChatGPT so I put ChatGPT inside of your Scala compilation so that you can chat with ChatGPT while you compile Scala
//> using lib "com.softwaremill.sttp.openai::core:0.0.6"
object ai:
import scala.quoted.*
import sttp.openai.OpenAISyncClient
import sttp.openai.requests.completions.chat.*
import sttp.openai.requests.completions.chat.ChatRequestBody.ChatBody
import sttp.openai.requests.completions.chat.ChatRequestBody.ChatCompletionModel
opaque type GPT[A <: String] <: String = String
@lukepighetti
lukepighetti / config.toml
Last active January 13, 2025 18:32
Helix – tree file picker... TODAY?!?
[keys.normal]
C-f = [":new", ":insert-output lf-pick", ":theme default", "select_all", "split_selection_on_newline", "goto_file", "goto_last_modified_file", ":buffer-close!", ":theme tokyonight_storm"]
@Kirill255
Kirill255 / vk_methods.md
Last active December 18, 2024 12:43
список скрытых/открытых методов API

Проверять метод на скрытость, можете тут: vk.com/dev/МЕТОД

@munrocket
munrocket / shadertoy_exporter.js
Last active May 14, 2025 04:14
How to record cycled video from shadertoy
// copy paste this in console
function shader_exporter(duration, width, heigth, paused) {
document.getElementById('demogl').style.width = width + 'px';
document.getElementById('demogl').style.height = heigth + 'px';
document.getElementById('myResetButton').click();
document.getElementById('myRecord').click();
if (paused) document.getElementById('myPauseButton').click();
let t0 = performance.now();
function loop(){
if (performance.now() - t0 > duration * 1000) {
— Да?
— Алё!
— Да да?
— Ну как там с деньгами?
— А?
— Как с деньгами-то там?
— Чё с деньгами?
— Чё?
— Куда ты звонишь?
@MichaelCurrin
MichaelCurrin / README.md
Last active April 6, 2025 18:23
GitHub GraphQL - Get files in a repository

Get GitHub Files

Get the metadata and content of all files in a given GitHub repo using the GraphQL API

You might want to get a tree summary of files in a repo without downloading the repo, or maybe you want to lookup the contents of a file again without download the whole repo.

The approach here is to query data from GitHub using the Github V4 GraphQL API.

About the query

@taig
taig / load-image.scala
Last active October 13, 2025 20:36
Scala.js image loading with cats Deferred
import cats.effect.concurrent.Deferred
import cats.effect.implicits._
import cats.effect.{ConcurrentEffect, IO}
import cats.implicits._
import org.scalajs.dom.html.Image
import org.scalajs.dom.{document, Event}
def loadImage[F[_]](url: String)(implicit F: ConcurrentEffect[F]): F[Boolean] =
for {
promise <- Deferred[F, Boolean]