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
To create a second name for the variable or method. | |
alias | |
A command that appends two or more objects together. | |
and | |
Designates code that must be run unconditionally at the beginning of the program before any other. | |
BEGIN | |
Delimits a "begin" block of code, which can allow the use of while and until in modifier position with multi-line statements. |
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
http://min.us/liueSPMQD9ZCN | |
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
Count Queries | |
1. There are 240 Republican representatives. | |
2. There are 187 Democratic representatives. | |
3. There are 51 Democratic senators, 47 Republican senators. | |
The questions asks for "representatives", but the details below it ask to specify if it's a Rep or Sen, so we've | |
compiled the lists using all Rep's and Sen's. | |
select name, location, party, substr(name, 0, 4), years_in_congress from congress_members order by grade_level_since_1996 limit 10; |
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 Cohort < Database::Model | |
def self.all | |
Database::Model.execute("SELECT * FROM cohorts").map do |row| | |
Cohort.new(row) | |
end | |
end | |
def self.create(attributes) | |
record = self.new(attributes) | |
record.save |
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
<!-- Code goes here --> | |
require 'csv' | |
require 'sqlite3' | |
class CongressParser | |
$db = SQLite3::Database.new "congress_members.db" | |
attr_accessor :file, :congress_members | |
def initialize(file) | |
@file = file |
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 Cohort < Database::Model | |
self.table_name = 'cohorts' | |
attr_reader :attributes, :old_attributes | |
# e.g., Cohort.new(:id => 1, :name => 'Alpha', :created_at => '2012-12-01 05:54:30') | |
def [](attribute) |
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
https://github.com/tinybeauts/flashcards_web_app.git |
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
.container { | |
/* | |
If you have a block-level element of a certain width, margin: 0 auto; | |
will how you center it inside its parent container. | |
See: http://bluerobot.com/web/css/center1.html | |
Don't change the container width. | |
*/ | |
margin: 0 auto; |
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
.container { | |
/* | |
If you have a block-level element of a certain width, margin: 0 auto; | |
will how you center it inside its parent container. | |
See: http://bluerobot.com/web/css/center1.html | |
Don't change the container width. | |
*/ | |
margin: 0 auto; |
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
<form name="sign_up" action="#" method="post"> | |
<label for="email">Email</label> | |
<input type="text" name="email" /> | |
<label for="password">Password</label> | |
<input type="password" name="password" /> | |
<button type="submit">Sign Up</button> | |
<ul id="errors"></ul> | |
</form> |
OlderNewer