Skip to content

Instantly share code, notes, and snippets.

@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/">
@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 / adding_data.sql
Created October 4, 2012 15:32
Adding Data
INSERT INTO user (id, first_name, email)
VALUES ( 0, "Josh", "jrowley@gmail.com");
INSERT INTO user (id, first_name, email)
VALUES ( 1, "Aaron", "aaron@gmail.com");
INSERT INTO user (id, first_name, email)
VALUES ( 2, "Matt", "matt@gmail.com");
INSERT INTO user (id, first_name, email)
@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 / 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 / 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 / song_library.rb
Created October 17, 2012 19:55
Solutions to Song Library mini
def assert_equal(actual, expected)
if expected == actual
puts 'pass'
else
puts "fail: expected #{expected}, got #{actual}"
end
end
def assert(statement)
if statement
@styliii
styliii / jukebox.rb
Created October 18, 2012 05:22
JukeBox Challenge
class JukeBox
# attr_accessor :request
@@songs = [
"The Phoenix - 1901",
"Tokyo Police Club - Wait Up",
"Sufjan Stevens - Too Much",
"The Naked and the Famous - Young Blood",
"(Far From) Home - Tiga",
"The Cults - Abducted",
"The Phoenix - Consolation Prizes"
@styliii
styliii / test_example
Created November 6, 2012 20:15
test example
# 11.6.12
# Jack Dorsey - creator of Twitter
# gem 'rspec'
# bundle
# rails g rspec: install
# in spec, create new folder, models
# rails g test_unit: model Song #=> didn't work as expected
# create songs_spec.rb
@styliii
styliii / git-completion.bash
Created December 3, 2012 15:03
git completion
#!bash
#
# 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:
#