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
# Configuring Our Prompt | |
# ====================== | |
# This function is called in your prompt to output your active git branch. | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
# This function builds your prompt. It is called below | |
function prompt { |
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
FactoryGirl.define do | |
# tags | |
factory :happy_tag, class: Tag do |t| | |
t.name "happy" | |
end | |
factory :funny_tag, class: Tag do |t| | |
t.name "funny" | |
end | |
factory :fluffy_tag, class: Tag do |t| | |
t.name "fluffy" |
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
host_user = User.new | |
host_user.name = "Host User" | |
host_user.save | |
guest_user = User.create(:name => "Guest User") | |
not_attending_user = User.create(:name => "Not Attending User") | |
attending_user = User.create(:name => "Attending User") | |
birthday = Event.create(:name => "Birthday", :host => host_user) | |
holiday_party = host_user.hosted_events.create(:name => "Holiday Party") |
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
json.array!(@listings) do |listing| | |
json.extract! listing, :id, :address, :listing_type, :title, :description, :price, :neighborhood_id, :host_id | |
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
class ListingsController < ApplicationController | |
before_action :set_listing, only: [:show, :update, :destroy] | |
# GET /listings | |
def index | |
if listing_type = params[:listing_type] | |
@listings = Listing.where(listing_type: listing_type) | |
elsif price = params[:price] | |
@listings = Listing.where(price: price) | |
else |
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
Working with the cloud CLI: | |
`spark cloud login` | |
Positive end (shorter end) of the LED pin needs to be curcuit | |
Negative end (longer end) of LED pin needs to be on the resister | |
Negative Goes to Ground | |
Resister connects to the Input, and one below the Input point, connect the Cable; one end of Cable goes to the Ground (GND) | |
Motor: | |
Red positive |
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
Place the plate in front of you with curve facing upward. | |
Open the bag of bread. | |
Take out two pieces of bread. | |
Place the bag of bread off to the side. | |
Place the two pieces of bread in on the plate so that they are vertical and parallel to each other. | |
Unscrew the jar of peanut butter. | |
Place the peanut butter jar lid off to the side. | |
Unscrew the jar of jelly. | |
Place the jelly jar lid off to the side. | |
Pick up the jar of peanut butter in one hand. |
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
Name: Amanda Himmelstoss | |
Github: http://github.com/ahimmelstoss | |
Blog: ahimmelstoss.github.io | |
Tagline: Aspiring builder. | |
Profile Picture: specific file on computer | |
Treehouse Account: http://teamtreehouse.com/ahimmelstoss | |
CoderWall Account: https://coderwall.com/ahimmelstoss | |
CodeSchool Account: http://www.codeschool.com/users/ahimmelstoss | |
Favorite Websites: |
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
CREATE TABLE wizards( | |
name TEXT, | |
age INTEGER | |
); | |
ALTER TABLE wizards ADD COLUMN color TEXT; | |
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
# 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 | |
# ====================================== |
OlderNewer