Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

James Lopez bluegod

Block or report user

Report or block bluegod

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:fa9fdb4a637df39de246
#One line (command line) solution in Ruby to the Lattice paths problem for a configurable 20x20 frame.
echo "r=20;n=r+20; ((0...r).inject(1) do |m,i| (m * (n - i)) / (i + 1) end)" | irb
@bluegod
bluegod / gist:92528d41deaba36bc64b
Created Aug 11, 2014
scanline-fill algorithm written in Ruby (non-recursive version)
View gist:92528d41deaba36bc64b
# Scanline-fill <James.Lopez at bluegod.net>
# GPLv2 License
# I've based this method on:
# http://en.wikipedia.org/wiki/Flood_fill#Scanline_fill
# Seems the most efficient way as alternatives:
# Recursion: Stack overflow problem
# Pixel by pixel: at least 1 order of magnitude less efficient.
#
# https://github.com/bluegod/scanlinefill
@bluegod
bluegod / gist:d0a5ce8eeb82475a843f
Created Aug 11, 2014
Backron - filesystem/DB backup script. (old)
View gist:d0a5ce8eeb82475a843f
#!/bin/sh
# Backron - Full and incremental backup script
# Based on a script by Daniel O'Callaghan <danny@freebsd.org>
# Done by James López (BLuEGoD) <bluegod at bluegod.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
You can’t perform that action at this time.