Skip to content

Instantly share code, notes, and snippets.

View TrevMcKendrick's full-sized avatar

Trevor McKendrick TrevMcKendrick

View GitHub Profile
########################
# NYC PIGEON ORGANIZER #
########################
# Start with the following collected data on NYC pigeons.
pigeon_data = {
:color => {
:purple => ["Theo", "Peter Jr.", "Lucky"],
:grey => ["Theo", "Peter Jr.", "Ms .K"],
"Which SQL command selects all the columns from the sable?"
SELECT *
SELECT all
SELECT rows
SELECT every_one_of_them
"Which SQL command is used to sort the result-set?"
SORT
ARRANGE
SORT_BY
class Jukebox
attr_accessor :songs, :desire, :current_song #:song_hash
def initialize(songs)
@songs = songs
#@song_hash = {}
help
end
class Student
attr_accessor :name, :twitter, :linkedin, :facebook, :website
attr_reader :id
@@students = []
def initialize
@@students << self
@id = @@students.count
end
class School
attr_accessor :name, :roster
def initialize(name)
@roster = {}
@name = name
end
def add_student(student_name, grade)
require 'simplecov'
SimpleCov.start
require 'json'
require 'rspec'
require_relative 'jukebox'
require_relative 'song'
RSpec.configure do |config|
# Use color in STDOUT
require 'sqlite3'
require 'pry'
class Student
attr_accessor :name, :twitter, :linkedin, :facebook, :website, :saved, :id
@@db = SQLite3::Database.new 'students.db'
@@students = []
require 'sqlite3'
require 'pry'
class Student
attr_accessor :name, :twitter, :linkedin, :facebook, :website, :saved, :id
@@db = SQLite3::Database.new 'students.db'
@@students = []
# Download this file:
# https://gist.github.com/aviflombaum/28534c5d69edd2439a7d/download
# Run it from your terminal with:
# ruby ruby.basics.rb
# (Just make sure you are in the right directory)
# ======================================
# Ignore All This Code
# ======================================
# **Tweet Shortener
# A client has hired you to automatically post some of their brand
# messages to twitter, but the problem is that some of them are too
# long. Your job is to shorten them by replacing longer words with
# shorter representations (i.e. "two" becomes "2").
# Write a method that will take a tweet, search it for words that you
# can substitute, and return a substituted string tweet. For instance,
# the tweet "Hello to you, I'm at home" would become "Hi 2 u, I'm @