Skip to content

Instantly share code, notes, and snippets.

View jesseract's full-sized avatar

Jessa Pearce jesseract

View GitHub Profile
@jesseract
jesseract / split_puzzle
Created February 25, 2015 02:40
Split test
require 'minitest/autorun'
require 'minitest/pride'
# Write two methods:
#
# * `first_name`: given a name in string, return the first name.
# * `last_name`: given a name in string, return the last name.
# WRITE YOUR CODE HERE.
def first_name(name)
require 'minitest/autorun'
require 'minitest/pride'
# Write a method which accepts one parameter. The method should return true if
# the string passed to it is a palindrome. It should return false if the string
# is not a palindrome
# WRITE YOUR CODE HERE.
def palindrome?(string)
s = string.downcase.delete('^a-z ')
@jesseract
jesseract / 2:26_challenge
Created February 26, 2015 14:23
I'm pretty sure the only thing I've retained in six weeks of code school is the fact that the little dinosaur you get when your internet dies in chrome is actually a playable game.
require 'minitest/autorun'
require 'minitest/pride'
# Write a series of methods which use the .any, .all, .map, .select, .reject, and
# .reduce methods in Enumerable. Each of your methods should be one line.
# WRITE YOUR CODE HERE. In this challenge, names longer than 5 characters are
# considered long.
def has_even?(array)
array.any? {|i| i.even?}
@jesseract
jesseract / 3:2_challenge
Created March 2, 2015 14:20
3/2_challenge
require 'minitest/autorun'
require 'minitest/pride'
# Write a class which has an initialize method, a reader method, a private
# method, and a class method.
# WRITE YOUR CODE HERE.
class Goat
def initialize(name)
@goat = Goat.new
require 'minitest/autorun'
require 'minitest/pride'
# Write a class which wraps around an array, but only allows odd numbers
# to be stored in the array.
class OddArray
def initialize(array)
end
require 'minitest/autorun'
require 'minitest/pride'
# Write two classes which inherit from the Vehicle class below. You will also
# need to add a method to the Vehicle class during this challenge.
class Vehicle
def initialize(make, model)
@make = make
@model = model
@jesseract
jesseract / 3:9_challenge
Last active August 29, 2015 14:16
3/9_challenge
Detailed Ruby Questions
What is the difference between a hash and an array?
A hash is an unordered collection of key/value pairs.
Arrays are ordered, integer-indexed collections of any object
Both are enumerables
No .first on a hash
No .keys on an array
What is the difference between a string and a symbol?
Detailed Rails Questions
What is the difference between form_for and form_tag?
Form_for is required for nested attributes, and is for a specific object. Form_tag can be used generally on the page and doesn't have to target a specific object. form_for @user do
When you submit a form_tag it posts and goes to the same page by default
Form_for goes to create/update by default
-create if the object it's targeting have never been saved, update if it has
What is the difference between render and redirect_to?
Render will render the form or whatever on your web page so you can see it. Redirect will send the user to another page on your site.
Detailed Supporting Technology Questions
Why would you use SCSS instead of CSS?
SCSS is cleaner, you can specify elements very specifically and whether they're contained in other elements
Easier to make a more uniform styling for an app
Nesting
SCSS is a bonus, css still works
You can assign variables and use those throughout your style
You can import files and make a mixin to make groups of CSS declarations that you want to reuse throughout your site
@jesseract
jesseract / ip_guys
Last active September 30, 2015 17:15
IP lawyers
Intellectual property
4 types of protection
1. patent -compositions of matter, devices
2. copyright - original expression (including software)
3. trademark - source id/consumer goodwill
4. trade secret - valuable, secret business
What is copyrightable?
-original works, including software
-default rule is authorship = ownership (unless it's a work made for hire for your employer)