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
| def add_item!(item, list) | |
| list << item unless list.include?(item) | |
| list | |
| end | |
| def remove_item!(item, list) | |
| list.delete(item) | |
| list | |
| end |
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 ArrayModifier | |
| attr_reader :array | |
| def initialize(array) | |
| @array = array | |
| end | |
| def exclaim | |
| new_array = [] |
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 President | |
| attr_accessor :name, :age | |
| def initialize(name, age) | |
| @name, @age = name, age | |
| end | |
| def citizenship | |
| self.class.citizenship | |
| end |
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 ArrayModifier | |
| attr_reader :array | |
| def initialize(array) | |
| @array = array | |
| end | |
| def exclaim | |
| new_array = [] |
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
| mkdir ~/bin | |
| touch ~/.bash_profile | |
| echo 'export PATH="~/bin:$PATH"' >> ~/.bash_profile | |
| echo "export EDITOR='subl -w'" >> ~/.bash_profile | |
| ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl | |
| source ~/.bash_profile |
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
| def save_with_initial_vote | |
| ActiveRecord::Base.transaction do | |
| saved = self.save | |
| self.create_vote | |
| saved | |
| end | |
| end |
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
| import random | |
| def show_guesses(): | |
| guesses.append(guess) | |
| print(str(guesses) + " {} more out of 5.".format(5 - len(guesses))) | |
| def show_help(): | |
| print("Guess a number between '1' and '10'") | |
| print("'DONE' quits and 'HELP' displays this help.") |
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
| <style type="text/css"> | |
| .html-marquee { | |
| height:200px; | |
| width:400px; | |
| background-color:ffff33; | |
| background-image:url(http://); | |
| font-family:Cursive; | |
| font-size:48px; | |
| color:000000; | |
| font-weight:bold; |
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
| @import url(http://fonts.googleapis.com/css?family=Cherry+Cream+Soda); | |
| $px-bright-orange: #df7934; | |
| $px-dark-orange: #9d331c; | |
| $px-aqua: #349ce6; | |
| $px-kolbolt: #283973; | |
| $px-electric-indego: #0030aa; |