Skip to content

Instantly share code, notes, and snippets.

View ToniRib's full-sized avatar

Toni Rib ToniRib

View GitHub Profile
@ToniRib
ToniRib / cfu_crud_in_sinatra.markdown
Last active December 2, 2015 15:44 — forked from rwarbelow/cfu_crud_in_sinatra.markdown
CRUD in Sinatra -- Check for Understanding
  1. Define CRUD.
  • the conventional way to interact with a database: create, read, update, delete
  1. There are seven verb + path combinations that are necessary in a basic Sinatra app in order to provide full CRUD functionality. List each of the seven combinations, and explain what each is for.
  • GET + /tasks - show all of the tasks
  • GET + /tasks/:id - show one task
  • GET + /tasks/new - show form to create a new task
  • POST + /tasks - create the new task
  • GET + /tasks/:id/edit - see the update task form for a specific task
  • PUT + /tasks/:id - update the task in the database
  • DELETE + /tasks/:id - delete a specific task
@ToniRib
ToniRib / lightning_talk_toni_rib_outline.md
Last active March 31, 2016 01:43
The Art of PowerPoint (or how to look like you know what you're doing)

The Art of PowerPoint

(or how to look like you know what you're doing)

Background

  • Came from aerospace engineering - seen A LOT of really bad presentations (and a few good ones)
  • The following are my personal suggestions based on what I've seen and how I design presentations

Note: Presentation is structured in a "don't do this, do this" two-slide format

@ToniRib
ToniRib / agile.markdown
Created December 7, 2015 17:24
Waterfall vs. Agile

Waterfall vs. Agile Development

  • The waterfall method is very difficult to adapt to any changes in requirements as they have to be contractually negotiated with the customer (which takes time) and then software rewritten in order to incorporate them (which also takes time). It's almost impossible to guess at how long a project is going to take, how many people will be needed over time, and how much money the entire thing is going to cost (even if the requirements never change). The Agile method seems very adaptable to changing customer requirements/expectations and after each iteration there is at least some working system, instead of lots of pieces of a super broken system.
  • It's popular because the customer almost never knows exactly what they want from the beginning, and as they see the product start to develop they get new ideas about how they might want to do things which need to be incorporated easily. Agile allows and encourages these things, especially continual communication with the customer.
@ToniRib
ToniRib / week-2-diagnostic.markdown
Last active December 11, 2015 16:32 — forked from rwarbelow/week-2-diagnostic.markdown
Week 2 Diagnostic
  1. Describe the request-response cycle. Start with the client making a request.
  • The client makes a request which gets routed to the DNS. The request includes headers which have an HTTP verb, a path, and other relevant information. The DNS server tries to resolve the path, and if it cannot, it passes it off to other servies (like the .com server) that will eventually resolve the request and pass the ip address of the correct server back to the client. The client can then send the request to the correct server. Once the server receives the request, it processes it based on whatever was in the request and compiles a response which consists of a status code, other headers, and a body which is a string of HTML if something is going to be rendered (or some other string based on whatever the request was). The client can then render the string to the screen for the user.
  1. Explain when each of these HTTP verbs would be used: GET, POST, PUT, DELETE.
  • GET: get information from the server to view on the screen
  1. What is the purpose of the router in a Rails project?
  • The router is used to take the incoming verb & path and find the corresponding controller action to run.
  1. What routes would be provided to you with the line resources :items?
  • All seven of the restful routes related to items, which would be:
    1. GET '/items'
    2. GET '/items/:id'
    3. GET '/items/new'
    4. POST '/items'
  1. GET '/items/:id/edit'
@ToniRib
ToniRib / models_databases_and_relationships.markdown
Last active December 15, 2015 19:05
Models, Databases, and Relationships

Models, Databases, and Relationships

  1. What is the difference between a primary key and a foreign key? Where would we find a primary key? What would it be called by default? Where would we find a foreign key? What is the naming convention for a foreign key?
  • A primary key is a unique identifier for records in a database table. A foreign key is a column in a table that references the primary key from a different table. A primary key is usually found in the first column of a database table, and by default is called just 'ID.' A foreign key could be in any column of a table, but is usually an integer referencing the primary key of a different table. The naming convention for a foriegn key is "_id" where is not plural. Foreign keys are used to link data in one table to data in another table.
  1. Write down one example of a one-to-one relationship.
  • A person has one registered username for a site
  1. Write down two examples of a one-to-many relationship.
  • I have three pets
@ToniRib
ToniRib / .bash_profile
Created January 7, 2016 15:52
Current bash profile
# Enable color alias
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -lGFah'
# Enable git aliases
alias gc='git commit'
alias ga='git add'
alias gs='git status'
alias gp='git push'
@ToniRib
ToniRib / git-completion.bash
Created January 7, 2016 15:54
git-completion
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# *) local and remote tag names
# bash/zsh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).
  • ? - on any page, pops up a window showing all of the keyboard shortcuts available on that page
  • g + d - Go to your dashboard from anywhere on GitHub
  • s - focus in on the search bar
  • g + c - If you're in a repo and NOT focused on the code tab (for example, looking at issues or settings), this will take you to the code tab
  • w - When browsing source code (clicked into a folder or file of your code in a repo), allows you to select a new branch from the list of branches
  • t - When in a repo, this opens the file finder allowing you to start typing a filename or scroll through the files to select one
  • l - When inside of a source code file, pops up a modal that allows you to type in a line number and hit enter, then jumps to that line in the file
  • g + p - When inside of a repo, goes to the pull requests tab for that repo. Useful if you're collaborating on a project and approving/reviewing a lot of pull requests

[GitHub Shortcuts CheatSheet](https://help.github.com/articles/usi