This file contains hidden or 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
// Set up Ubuntu on Ec2 instance | |
// Install unzip. | |
sudo apt-get install unzip | |
// Download Vault and Consul(if necessary) | |
wget https://releases.hashicorp.com/vault/0.6.2/vault_0.6.2_linux_amd64.zip |
This file contains hidden or 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
Normal Mode - No Joins Required! | |
How many users are there? | |
SELECT SUM(id) FROM users; | |
What are the 5 most expensive items? | |
SELECT * FROM items ORDER BY price desc LIMIT 5; | |
What's the cheapest book? (Does that change for "category is exactly 'book'" versus "category contains 'book'"?) | |
SELECT * FROM items WHERE category LIKE "%Books%" ORDER BY price asc LIMIT 1 |
This file contains hidden or 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
require "set" | |
require "pry" | |
board = [1,2,3,4,5,6,7,8,9] | |
MAX_TURNS = 9 | |
# def display_board(board) | |
# puts | |
# 3.times do |row| |
This file contains hidden or 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
# Hangman 2.0 | |
## Data/Variables in the system | |
# * dictionary | |
# * guesses | |
# * turn_count | |
# * answer | |
## Open Questions | |
# How do we show progress? letter pool (alphabet - guesses) |
This file contains hidden or 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
# Hangman 2.0 | |
## Data/Variables in the system | |
# * dictionary | |
# * guesses | |
# * turn_count | |
# * answer | |
## Open Questions | |
# How do we show progress? letter pool (alphabet - guesses) |
This file contains hidden or 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
## computer randomly picks a number | |
## user guesses number higher or lower than the random number | |
## if user guess correct than puts correct | |
def guessgame | |
prng = rand(100) | |
puts "Guess a number between 0-100" | |
input = gets.chomp.to_i | |
until input == prng | |
if input > prng |