Skip to content

Instantly share code, notes, and snippets.

View goyalankit's full-sized avatar
🏠
Working from home

Ankit Goyal goyalankit

🏠
Working from home
View GitHub Profile
@ggPeti
ggPeti / spiral.rb
Last active December 26, 2015 17:39
Procedural Ruby solution for the Spiral task
def spiral(h, w, r, c)
spiral = []
step_counts = (1..Float::INFINITY).lazy.flat_map { |n| [n, n] }
directions = [:up, :left, :down, :right].cycle
while spiral.length < h * w
spiral << (r - 1) * w + c if r.between?(1, h) && c.between?(1, w)
if (current_step_count ||= 0).zero?
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active March 21, 2025 15:01
Backend Architectures Keywords and References
@jakeonrails
jakeonrails / Ruby Notepad Bookmarklet
Created January 29, 2013 18:08
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>