Skip to content

Instantly share code, notes, and snippets.

View jah2488's full-sized avatar

Justin Herrick jah2488

View GitHub Profile
@jah2488
jah2488 / coin-changer-kata.md
Created October 13, 2021 16:11
Description of the Coin Changer Kata

Coin Changer Kata

Description

Using the RGR (Red. Green. Refactor.) loop of TDD, write a method that accepts an positive integer value and returns an array of the smallest amount of change possible for that amount.

Examples

change(99) #=> [25, 25, 25, 10, 10, 1, 1, 1, 1]
change(72) #=> [25, 25, 10, 10, 1, 1]
@jah2488
jah2488 / 1-solution.rb
Created May 17, 2019 16:23
The many phases of Raindrops from Exercism.
require 'prime'
module Raindrops
extend self
def convert(n)
primes = n.prime_division.flatten
if primes.any? { |x| [3,5,7].include?(x) }
primes.map do |x|
case x
when 3 then 'Pling'
find * -name package.json | xargs grep '"license[s]*"' -A 3 | grep -o ': ".*"' | xargs ruby -e "puts ARGV.reduce({}) { |acc, n| acc[n] = (acc[n] || 0) + 1; acc }"
# Sample usage
# cd to book folder
# ruby feed_seeder.rb && dropcaster > index.rss && aws s3 sync . "s3://audiobooks-rss/My Book Name" --acl public-read
require 'colorize'
require 'optparse'
DEFAULT_DESCRIPTION = "Books are cool"
DEFAULT_IMAGE = "https://pbs.twimg.com/profile_images/378800000448533787/c32fb13e160ee7cd17848e8cacbbcfc5_400x400.jpeg"
DEFAULT_PATH = "."
{
"questions": [
{
"id": 1,
"displayName": "Favorite Food?",
"type": "text"
},
{
"id": 2,
"displayName": "Favorite Character Build",
@jah2488
jah2488 / elm.md
Last active March 22, 2018 18:05

Elm Resources

So you want to learn Elm? Excited to hear it. To get started, its going to help to have some guidance along the way. Below I've collected various helpful resources and tips to get you started.

Starting Out

Things To Do

Elm Resources

So you want to learn Elm? Excited to hear it. To get started, its going to help to have some guidance along the way. Below I've collected various helpful resources and tips to get you started.

Starting Out

Things To Do

@jah2488
jah2488 / setup.rb
Last active May 3, 2017 00:56
A setup script for a new laptop. (Assumes you have homebrew and homebrew cask installed)
class Package < Struct.new(:command, :name, :opts)
def install!
if not_installed?
system("#{command} install #{name} #{opts.join(" ")}")
end
end
def not_installed?
!exists?
end
html {
background: #F7F7F7;
color: red;
height: 100%;
}
body {
min-height: 100%;
}
.wrapper {