Skip to content

Instantly share code, notes, and snippets.

View ahimmelstoss's full-sized avatar

Amanda Himmelstoss ahimmelstoss

View GitHub Profile
# 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 {
@ahimmelstoss
ahimmelstoss / factories.rb
Created May 14, 2014 20:51
factory girl for blog lab
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"
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")
@ahimmelstoss
ahimmelstoss / index.json.jbuilder
Created July 29, 2014 20:03
jbuilder for listings index
json.array!(@listings) do |listing|
json.extract! listing, :id, :address, :listing_type, :title, :description, :price, :neighborhood_id, :host_id
end
@ahimmelstoss
ahimmelstoss / listings_controller.rb
Created July 29, 2014 19:55
Listings Controller
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
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
@ahimmelstoss
ahimmelstoss / Alien Sandwich
Last active December 23, 2015 18:49
On making a peanut butter and jelly sandwich, for Aliens.
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.
@ahimmelstoss
ahimmelstoss / Profile information
Created September 24, 2013 00:12
Handy profile information
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:
@ahimmelstoss
ahimmelstoss / magical.db
Created September 25, 2013 03:27
magical.db for SQL homework
CREATE TABLE wizards(
name TEXT,
age INTEGER
);
ALTER TABLE wizards ADD COLUMN color TEXT;
@ahimmelstoss
ahimmelstoss / ruby_basics_TODO
Created September 25, 2013 13:37
ruby basics TODO
# 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
# ======================================