Skip to content

Instantly share code, notes, and snippets.

View mcshakes's full-sized avatar

Mac McCarthy mcshakes

View GitHub Profile
@mcshakes
mcshakes / HW Solution
Created December 16, 2014 03:32
99 Bottles of Beer...
bottle = 99
while bottle > 0
puts "#{bottle} bottle#{'s' unless bottle == 1} of beer on the wall,"
puts "#{bottle} bottle#{'s' unless bottle == 1} of beer."
puts "Take one down, pass it around"
"#{bottle} bottles of beer on the wall!"
bottle -= 1
@mcshakes
mcshakes / HW Solution
Created December 17, 2014 05:50
credit_check
card_number = "4929735477250543"
separate_nums = card_number.chars.map(&:to_i).reverse
initial_collection = separate_nums.each_with_index.map do |digit,index|
if index.odd?
digit *= 2
else
digit
end
end
@mcshakes
mcshakes / credit_check.rb
Created December 18, 2014 05:54
Luhn_test
class CreditCheck
def validate(digits)
if digits.empty?
false
else
chars = digits.chars
numbers = []
chars.each {|char| numbers << char.to_i}
numbers.reverse!
@mcshakes
mcshakes / Encrypt.rb
Created December 19, 2014 16:58
HW Solution
key = 13
message = "This is my secret"
encrypted_message = message.downcase.tr('a-z', 'n-za-m')
puts encrypted_message.capitalize
### Returns Guvf vf zl frperg
### This is a lame solution.
@mcshakes
mcshakes / gist:cc8e874304936cafc306
Created March 11, 2015 21:26
Lighting Talk: Anonymous
Philosophy and Organization Hierarchy:
- whether they all actually adhere to same targets and belief system, or any group of hackers could just declare themselves as an offshoot. (Kind of like what Boko Haram did with ISIS)
- Looking at offshoots and seeing how they relate to Anonymous (main) activities.
History:
Early 4chan raids (I’ll keep these brief) to the Hebdo shooting campaigns. This would be good segue to any Political analysis maybe.
@mcshakes
mcshakes / gist:14b96e7e8870cc54231f
Created April 14, 2015 20:56
Lighting Talk: Open Data and Agriculture

How Precision Farming will feed 9 billion people in 2050

Why: Water scarcity - CO uses over 80% of water for agriculture - Increased drought seasons and length of time; desertification of previous agricultural breadbowls - Rapidly decreasing fresh water supplies and aquifers Food Security - Global output is down by 15 percent, while in 10 years we need to be producing a third more grains - Increased meat consumption leads to higher need for grain output

Ways Open Data mingles with farming:

* Name of the project
OceanClimate (for now. I hate naming things)
* URL
https://oceanclimate.herokuapp.com/
* What did you work on
@mcshakes
mcshakes / gist:f8c17ba091e4808a8636
Last active August 29, 2015 14:22
Lightning Talk: Folding@Home and Alzheimers (not final title)

What Folding@Home is:

  • How protein folding works
  • Science behind it
  • "Crowdsourcing" home computers

Actual Results with Alzheimers

  • Sciencey drug stuff
  • More Science

How people contribute

@mcshakes
mcshakes / Code Challenge: Storedom
Last active August 29, 2015 14:22
A Code Challenge: Storedom
# Module 4 First Code Challenge
This challenge is intended to help you assess your readiness for the end-of-module assessment and for upcoming technical interview assignments. You'll be given 3 hours, from 9:00 AM to 12:00 PM to complete the 2 challenges described below. At the end of the allotted time, you should push your code to a repo so that you can review it with an instructor later. Along the way, you should be making regular commits that demonstrate your work process.
For both of these challenges, we'll be using the existing Storedom application. Clone and set it up according to the instructions [here](https://github.com/turingschool-examples/storedom).
### Challenge 1: Storedom Order Flow and Order Notification Service
For this challenge we'll be adding a simple order flow to the Storedom App and then constructing a small notification feature which alerts our administrators whenever new orders are placed.
@mcshakes
mcshakes / gist:1facb9754881ff041085
Last active September 2, 2015 19:20 — forked from ryansobol/gist:5252653
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.