This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
require 'minitest/pride' | |
def palindrome?(input) | |
input.downcase! | |
array = input.split(" ") | |
array = array.join | |
input2 = array.to_s | |
if input2 == input2.reverse | |
return true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
require 'minitest/pride' | |
# Write a method which accepts an array and returns a sum of the elements in the | |
# array. Specifying a second parameter (e.g. 3) will allow you to sum all the | |
# items starting from index 3. Specifying three parameters will allow you to sum | |
# between two indices (e.g. everything between 3 and 6, inclusive). | |
# WRITE YOUR CODE HERE. Name your method `subsum`. | |
def subsum(array, x = -1, y = -1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
require 'minitest/pride' | |
# Write a class which has an initialize method, a reader method, a private | |
# method, and a class method. | |
# WRITE YOUR CODE HERE. | |
class Goat | |
def initialize(name = "default") | |
@name = name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OddArray | |
def initialize(odd_array) | |
@odd_array = odd_array | |
end | |
def to_a | |
odd_only_array = [] | |
@odd_array.each do |number| | |
if number.class == Fixnum && number.odd? | |
odd_only_array << number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
require 'minitest/pride' | |
# Write two classes which inherit from the Vehicle class below. You will also | |
# need to add a method to the Vehicle class during this challenge. | |
class Vehicle | |
def initialize(make, model) | |
@make = make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
require 'minitest/pride' | |
# Write code which will be included in the human class which will give humans | |
# intelligent and bipedal behavior. | |
# WRITE YOUR CODE BELOW THIS COMMENT... | |
module Intelligent | |
NUMBER_OF_BRAINS = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Build list of instance IDs by instance name | |
ec2_instance_facts: | |
region: "{{ region }}" | |
filters: | |
"tag:NightlyBackup": "Yes" | |
# "tag:Name": "{{ groups['backup'] }}" | |
register: ec2_facts | |
- debug: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'uri' | |
require 'json' | |
require 'java' | |
## | |
# Delegate script to connect Cantaloupe to Fedora. It slices a piece of | |
# Cantaloupe for Samvera to consume. | |
# | |
# This is a first pass and doesn't have a lot of error checking built in yet. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<< //// | |
This function will ssh into a EC2 based on Name tags. You can ssh in via public or private IP This function requires awscli to work | |
There are several optional environment variables: | |
AWS_PROFILE = Control which profile is active with this variable, if this is unset the function will use AWS_DEFAULT_PROFILE instead | |
SSH_EC2_KEY_FILE = path to the key file for the user | |
SSH_EC2_USER = name of the user that logs in, if this variable is unset the value is ec2-user | |
To use this function do the following commands | |
(from command line) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'uri' | |
require 'json' | |
require 'java' | |
## | |
# Delegate script to connect Cantaloupe to Fedora. It slices a piece of | |
# Cantaloupe for Samvera to consume. | |
# | |
# This is a first pass and doesn't have a lot of error checking built in yet. |