Skip to content

Instantly share code, notes, and snippets.

View meaganewaller's full-sized avatar

Meagan Waller meaganewaller

View GitHub Profile
@meaganewaller
meaganewaller / example.rb
Created May 1, 2013 05:01
./example.rb:42: Use RbConfig instead of obsolete and deprecated Config. When running. Any insight to this?
class Magical
def power
puts 'certain power a magical being would have'
end
end
class Wizard < Magical
def power
puts 'The Ground Starts to Shake'
end
@meaganewaller
meaganewaller / BundleInstallOutput.bash
Created May 21, 2013 15:22
Attempting to do bundle install on any project, and I'm always having to install gems manually before continuing. Goes through all the gems, saying "Using [enter gem here]" and then it will get to a gem that says "Installing [gem here]", it will stall, and then give the output below. However, you can replace 'json(1.7.7)' and 'json -v '1.7.7' wi…
Errno::EACCES: Permission denied - /Users/meaganwaller/.rvm/gems/ruby-1.9.3-p392/build_info/json-1.7.7.info
An error occurred while installing json (1.7.7), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.7'` succeeds before bundling.
@meaganewaller
meaganewaller / base_condition.rb
Created July 1, 2013 17:25
Eliminating Recursion with Stacks
def base_condition_for_comb(n,m)
(1 == n) || (0 == m) || (m == n)
end
@meaganewaller
meaganewaller / gist:6202399
Created August 10, 2013 22:10
message when trying to run a rails server
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError)
from <internal:gem_prelude>:1:in `<compiled>'
@meaganewaller
meaganewaller / player_factory.rb
Created October 28, 2013 15:25
PlayerFactory-SOLID
module TicTacToe
class PlayerFactory
def self.create(input)
case input[:type]
when :ai
AI.new(input[:mark])
when :human
Human.new(input[:mark])
else
raise "Invalid Player Type"
@meaganewaller
meaganewaller / animal.rb
Last active December 26, 2015 19:09
OCP Principle Animal
class Animal
def breathe(animal)
if animal == "cat"
puts "inhale and exhale"
elsif animal == "dog"
puts "inhale and exhale"
elsif animal == "cow"
puts "inhale and exhale"
end
end
@meaganewaller
meaganewaller / animalinheritance.rb
Created October 28, 2013 16:04
animalinheritance
class Mammal
def breathe
puts "inhale and exhale"
end
end
class Cat < Mammal
def speak
puts "meow"
end
class Rectangle
attr_reader :width, :height
def initialize(width, height)
@width = width
@height = height
end
def area
@width * @height
@meaganewaller
meaganewaller / gist:7254567
Created October 31, 2013 18:29
Mavericks iMac Question
1. Upgraded to Mavericks OS last night
2. Went to use her computer this morning, turned her computer on, got to the log in screen and got an error saying "Problem Occured Has to Restart Report Sent to Apple"
3. Computer restarted on it's own
4. Same thing keeps happening, gets to where she logs in with her password, and the same error keeps coming up, and restarting on it's own.
Her computer is stuck in a restart loop after upgrading to Mavericks.
I've tried to help her with some basic stuff:
- Her computer wasn't chiming with the start up tone, after resetting her SMC & PRAM the startup tone is back, but the problem is still happening.
package com.kata.junit;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
public class PrimeFactorsTest {
private PrimeFactors primeFactors;