Skip to content

Instantly share code, notes, and snippets.

View oshliaer's full-sized avatar
😼
Cat face with wry smile

Alex Ivanov oshliaer

😼
Cat face with wry smile
View GitHub Profile
@oshliaer
oshliaer / Clean transcript v5 (collected).md
Created September 30, 2026 13:08
The Handy post process system prompt for fixing Russian input

Provider

Grok

Model

openai/gpt-oss-120b

Prompt instructions

@oshliaer
oshliaer / flexcard-turnstile-badge.user.js
Last active September 25, 2026 13:40
Userscript: Cloudflare Turnstile readiness badge for the FlexCard login page.
// ==UserScript==
// @name Cloudflare Turnstile readiness badge
// @namespace oshliaer.flexcard
// @version 1.2.0
// @description Shows when the Cloudflare Turnstile token is ready and blocks form submission while it is still empty
// @author oshliaer
// @match https://flexcard.cards/accounts/login/*
// @updateURL https://gist.githubusercontent.com/oshliaer/dea4d098d1a4ecb38d588208588d57cf/raw/flexcard-turnstile-badge.user.js
// @downloadURL https://gist.githubusercontent.com/oshliaer/dea4d098d1a4ecb38d588208588d57cf/raw/flexcard-turnstile-badge.user.js
// @run-at document-idle
@oshliaer
oshliaer / retryable_module.rb
Created September 17, 2026 13:28
Модуль для повторного выполнения кода (Retry Pattern) с экспоненциальной задержкой. Демонстрирует фильтрацию типов ошибок, ограничение максимального числа попыток и изоляцию демонстрационного кода через if __FILE__ == $0.
module Retryable
# Класс BrokenFnError представляет собой пользовательскую ошибку, которая может быть выброшена функцией randomly_failing_method
# Ошибки, которые можно использовать в полезном контексте: сетевые ошибки, ошибки ввода-вывода, работы с файлами
class BrokenFnError < StandardError; end
ALLOWED_ERRORS = [BrokenFnError]
# Функция exponential_retry выполняет блок кода с экспоненциальной повторной попыткой при возникновении разрешенных ошибок
def self.exponential_retry(max_attempts = 3)
attempt = 0
@oshliaer
oshliaer / ruby_books.md
Created July 31, 2026 15:07 — forked from baweaver/ruby_books.md
A list of books for learning and expanding on your Ruby knowledge.

Ruby Book List

Learning Ruby

You're taking your first steps into Ruby

A good introduction to programming in general. Easy on newer programmers.

Order the table on https://ankiweb.net/shared/addons/ by ratings

{
  const data = [...document.querySelectorAll('tr')].map((row) => [
    row,
    ...[...row.querySelectorAll('td')].map((cell) => cell.innerHTML),
  ]);
  const out = data.filter((item) => item.length === 8);
 out.sort((a, b) =&gt; b[5] - a[5]);
@oshliaer
oshliaer / machine.js
Created October 9, 2021 06:40
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@oshliaer
oshliaer / readme.md
Last active December 9, 2022 13:57 — forked from NileDaley/repos.md
Change `cd` directory to the git repository using fzf (fuzzy search)

A git repositories finder on fzf

I use this little function (repo) on the command line to allow me to switch between different repositories easily using fzf

Prerequisits

  • fzf
  • zsh or bash

Installation

@oshliaer
oshliaer / .md
Created August 18, 2021 13:38
Symbols
  • ⎇ -- U+2387, ALTERNATIVE KEY SYMBOL
@oshliaer
oshliaer / .readme.md
Last active October 9, 2023 06:39 — forked from pilbot/ChunkyCache.gs
Using the Google Apps Script Cache Service for objects above 100Kb
@oshliaer
oshliaer / appsscriptzoneids.csv
Created February 7, 2021 14:14 — forked from mhawksey/appsscriptzoneids.csv
ZoneIds used in Google Apps Script
value text
Pacific/Midway (GMT-11:00) Midway
Pacific/Niue (GMT-11:00) Niue
Pacific/Pago_Pago (GMT-11:00) Pago Pago
Pacific/Honolulu (GMT-10:00) Hawaii Time
Pacific/Johnston (GMT-10:00) Johnston
Pacific/Rarotonga (GMT-10:00) Rarotonga
Pacific/Tahiti (GMT-10:00) Tahiti
Pacific/Marquesas (GMT-09:30) Marquesas
America/Anchorage (GMT-09:00) Alaska Time