Skip to content

Instantly share code, notes, and snippets.

View radanskoric's full-sized avatar

Radan Skorić radanskoric

View GitHub Profile
@radanskoric
radanskoric / PROMPT.md
Last active May 13, 2025 17:43
Test run of a simple coding agent with the prompt to create an ASCII minesweeper.

Implement a CLI game of Minesweeper using Ruby. Make sure to cover it with tests. The game should work by generating a minesweeper board, printing it and asking the user for the coordinates of the cell they wish to uncover. The board should be printed using the following notation: # for a still hidden field, 1-8 for a field with that many mines in the neighborhood, . for a field with no neighbors with mines and * for a mine. The program should correctly detect losing the game by hitting a mine and winning the game by uncovering all the fields without mines.

@radanskoric
radanskoric / app.rb
Created November 28, 2023 10:25
Turbo Frames and Streams on Sinatra
# This is a little experiment in using Turbo Frames and Streams without Rails.
# Built using just plain Sinatra as the web server.
#
# Make sure that you have sinatra and puma (or some other server) installed:
# gem install sinatra
# gem install puma
#
# You can then run the app with:
# ruby app.rb
require 'sinatra'
@radanskoric
radanskoric / async_activerecord.rb
Last active October 17, 2023 09:33
Rails 7.1 async database query execution key functionality recreated as plain Ruby, for better understanding
# == NOTE ==
# This gist is accompnaying a blog post on the topic: https://radanskoric.com/articles/understand-rails-async-db-queries
require 'bundler/inline'
require "benchmark"
require "debug"
require "uri"
gemfile do
source 'https://rubygems.org'

Keybase proof

I hereby claim:

  • I am radanskoric on github.
  • I am radan (https://keybase.io/radan) on keybase.
  • I have a public key whose fingerprint is 41F2 EF64 3313 5FFB 1084 F96F 4F46 CCB4 AE6D D809

To claim this, I am signing this object: