Skip to content

Instantly share code, notes, and snippets.

@styliii
styliii / app.rb
Created October 16, 2012 02:03
app file for sinatra example
# app.rb
require 'sinatra'
require 'json'
require 'data_mapper'
DataMapper.setup(:default, ENV['DATABASE_URL'])
get '/' do
@messages = Message.all
@styliii
styliii / Preferences.sublime-settings
Created October 15, 2012 23:50
preferences for sublime
{
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Solarized Color Scheme (TextMate)/Solarized (light).tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
".tags*",
"*.pyc",
@styliii
styliii / insert_quiz_2.sql
Created October 4, 2012 21:54
Questions and Answers to Quiz 2
INSERT INTO question (content, quizzes_id)
VALUES
("Who is the father of relational databases?", 2),
("What is referential integrity?", 2),
("In a one to many relationship, which table contains the foreign key?", 2),
("What is a normalized table?", 2),
("How many different type of joins are there?", 2);
INSERT INTO choices (content, correct, questions_id)
VALUES
@styliii
styliii / adding_data.sql
Created October 4, 2012 15:32
Adding Data
INSERT INTO user (id, first_name, email)
VALUES ( 0, "Josh", "[email protected]");
INSERT INTO user (id, first_name, email)
VALUES ( 1, "Aaron", "[email protected]");
INSERT INTO user (id, first_name, email)
VALUES ( 2, "Matt", "[email protected]");
INSERT INTO user (id, first_name, email)
@styliii
styliii / quizschema.sql
Created October 4, 2012 15:31
Setting up the Database
CREATE TABLE user (
id INTEGER PRIMARY KEY,
first_name TEXT,
email TEXT
);
CREATE TABLE quiz (
id INTEGER PRIMARY KEY,
user_id INTEGER,
name TEXT
@styliii
styliii / index.html
Created October 2, 2012 23:12
other people's bios
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Flatiron School - Developing Professionals</title>
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width; initial-scale=1.0">
<link type="text/plain" rel="lol" href="/humans.lol/">