This file contains 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 Dictionary | |
def initialize | |
@dict = {} | |
end | |
def entries | |
@dict | |
end | |
def add(word, definition = nil) | |
@dict[word] = definition |
This file contains 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 Dictionary | |
def initialize | |
@dict = {} | |
end | |
def entries | |
@dict | |
end | |
def add(word) | |
# word_definition = {"word_definition" => nil} if word_definition.class == "String" |
This file contains 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
friends = ["Sally", "Mary", "Joe"] | |
love = [] | |
friends.each do |friend| | |
love << "I love " + friend + "." | |
end | |
puts love | |
class Array |
This file contains 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 'bitly' | |
require 'jumpstart_auth' | |
require 'klout' | |
class JSTwitter | |
attr_reader :client | |
def initialize | |
puts "Initializing..." |
This file contains 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
# Dependencies | |
require "csv" | |
require "sunlight" | |
require "date" | |
# Class Definition | |
class EventManager | |
INVALID_ZIPCODE = "00000" | |
INVALID_PHONE_NUMBER = "0"*10 | |
Sunlight::Base.api_key = "e179a6973728c4dd3fb1204283aaccb5" |
This file contains 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 RPNCalculator | |
attr_accessor :calculator | |
def initialize | |
@calculator = [] | |
@num1 = 0 | |
@num2 = 0 | |
end | |
def push(num) |
This file contains 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
DEBUG = false | |
LOAD_FROM_FILE = true | |
LOAD_FILENAME = "todo.txt" | |
NAME_LENGTH = 30 | |
PRIORITY_LENGTH = 13 | |
CREATED_LENGTH = 13 | |
COMPLETED_LENGTH = 13 | |
HELP_LENGTH = 40 |
This file contains 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
module AddressBook | |
class Person | |
attr_reader :first_name, :last_name, :email_addresses, :addresses, :phone_numbers | |
def initialize(first_name, last_name) | |
@first_name = first_name | |
@last_name = last_name | |
@email_addresses = [] | |
@addresses = [] | |
@phone_numbers = [] | |
end |
This file contains 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 Foundation | |
class SocketManager: NSObject, SRWebSocketDelegate { | |
let kSocketUrl: NSURL = NSURL(string: "wss://narwhal-sock.herokuapp.com/")! | |
var connectionAttempts: Int = 0 | |
var isConnected: Bool = false | |
var ws: SRWebSocket? | |
class var sharedInstance: SocketManager { | |
struct Static { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer