Skip to content

Instantly share code, notes, and snippets.

View Beengie's full-sized avatar
😎

Beengie Beengie

😎
  • Sequoia Tech Services, LLC
View GitHub Profile
@Beengie
Beengie / m2W1Qz-tl
Created December 3, 2013 04:35
Module 2 Week 1 Quiz (GoTeaLeaf)
1. Why do they call it a relational database?
-A relational database is a database which connects data between tables within one or many databases.
2. What is SQL?
-SQL is a standard language for accessing and manipulating databases. SQL stands for Structured Query Language. SQL lets you access and manipulate databases. SQL is an ANSI (American National Standards Institute) standard.
3. There are two predominant views into a relational database. What are they, and how are they different?
-The predominant views are one-to-many and many-to-many. The linking field is the "id" field, and it will link one record to many records, or many records to many records.
4. In a table, what do we call the column that serves as the main identifier for a row of data? We're looking for the general database term, not the column name.
@Beengie
Beengie / player-dealer card view
Created November 14, 2013 21:38
In my app, it calls out the player_view and the dealer_view separately. It retrieves the array then passes the suit and card value to the <img>. In the dealer method, it checks to see if the first card is passed which I handle with a session variable so that the dealer shows value is handled automatically also not just the card picture.
# in the blackjack.erb (which is the yield in the layout.erb)
<%= player_view %>
<%= dealer_view %>
# in the helper method of main.rb
def card_pic(card)
return "<img id=\"card\" src=\"images/cards/#{card[0]}_#{card[1]}.jpg\" />"
end
@Beengie
Beengie / show_env
Last active December 28, 2015 08:29
Environment data
# Sinatra environment
# Make sure that the link to the "bootstrap.min.js" file is correct in your layout.erb (shown below):
<script src="/vendor/bootstrap/js/bootstrap.min.js"></script>
# Put this in your .erb
<%= show_env %>
# Place constant inside of your main.rb
SHOW_ENVIRONMENT = true