This is a partial list of Ruby scripts that demonstrate my use of the language.
I've tried to give these files self-explanatory names, and they should run, for the most part, without dependencies (exception: httparty).
Released under an MIT license.
This counts how many streaks (example: HHH, TTTTT) occur in a simulation of flipping a coin 1 million times.
This is an example of CSV parsing, showing how many values are in common (here, addresses) between two CSV files.
This script parses a CSV to find a matching field (addresses).
This script converts plain text to HTML: it adds paragraph tags to a line unless I flagged it to not do that with a special character sequence ("XXX").
This script makes a GET request to an API endpoint and prints the result. With valid keys, it works.
This script shows the result of increaseing a base value 15 percent 100 times (as if a dollar amount was growing 15 percent each year for 100 years).
This script loops through 100 times and counts the value as a 'win' if it exceeds 65 and a 'loss' if less than 65.
This script does postfix notation math, if you have SBCL (Steel Bank Common Lisp) installed.
You provide it with the input like this:
./postfix_notation_math.rb "(+ 3 5)"
This script sums the values in a file (for this use case, rent check amounts) and prints the output.
This script replaces every line with a period with that line with a period, and a newline added in.
This script prints out the contents of the last modified file in the current directory.
This script sleeps for a random time (pauses for a random amount of time) before printing a sentence and exiting.
This script takes a file as input and prints it out again to the console with each line prepended with a line number.