Skip to content

Instantly share code, notes, and snippets.

View jrosaaen's full-sized avatar

Joshua Rosaaen jrosaaen

View GitHub Profile
@jrosaaen
jrosaaen / Client_Attributes.sql
Last active August 29, 2015 14:08
H3_Client_Attributes.sql file for creating the sql code to make the database. Copy this into SQLEditor to generate Ruby code for models and schema in Rails
# SQLEditor export: Rails Migration
# id columns are removed
class Untitled < ActiveRecord::Migration
def change
create_table :Arraignments do |t|
end
create_table :Arrests do |t|
end
@jrosaaen
jrosaaen / Client_Attributes
Last active August 29, 2015 14:08
H3_Client_Attributes XML file to create schema in SQL Designer
<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ -->
<!-- Active URL: https://socrates.devbootcamp.com/sql -->
<sql>
<datatypes db="postgresql">
<group label="Numeric" color="rgb(238,238,170)">
<type label="Integer" length="0" sql="INTEGER" re="INT" quote="" />
<type label="Small Integer" length="0" sql="SMALLINT" quote="" />
<type label="Big Integer" length="0" sql="BIGINT" quote="" />
<type label="Decimal" length="1" sql="DECIMAL" re="numeric" quote="" />
@jrosaaen
jrosaaen / 0_reuse_code.js
Created April 21, 2014 21:43
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jrosaaen
jrosaaen / gradebook2.js
Created March 29, 2014 03:10
gradebook2.js
/*
You will work with the following two variables. The first, students, holds the names of four students.
The second, scores, holds groups of test scores. The relative positions of elements within the two
variables match (i.e., 'Joseph' is the first element in students; his scores are the first value in scores.).
Do not alter the students and scores code.
*/
@jrosaaen
jrosaaen / gradebook.js
Created March 29, 2014 02:35
gradebook.js
/*
You will work with the following two variables. The first, students, holds the names of four students.
The second, scores, holds groups of test scores. The relative positions of elements within the two
variables match (i.e., 'Joseph' is the first element in students; his scores are the first value in scores.).
Do not alter the students and scores code.
*/
@jrosaaen
jrosaaen / 0.2.1-boggle_class_from_methods.rb
Last active August 29, 2015 13:56 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1boggle class challenge
class BoggleBoard
#your code here
class BoggleBoard
# This will create an object called board that I can use later to directly access the board
attr_reader :board
# Initialize the board
def initialize(board)
@board = board
end
@jrosaaen
jrosaaen / cc_num.rb
Created February 18, 2014 03:30
cc_num.rb
class CreditCard
def initialize(cc_num)
raise ArgumentError if cc_num.to_s.length != 16
@cc_num=cc_num
end
def check_card
@cc_num_array1 = @cc_num.to_s
#puts @cc_num
#puts @cc_num_array1
end
@jrosaaen
jrosaaen / guessing_game_2.rb
Created February 16, 2014 06:46
guessing_game_2.rb
class GuessingGame
def initialize(answer)
@answer=answer
end
#define methods for guess, high, low, correct, solved
# guess method takes in user input
def guess
puts "Whats your guess?"
last_guest=gets.chomp
last_guest=guess
@jrosaaen
jrosaaen / guessing_game_loop_error.rb
Last active August 29, 2015 13:56
guessing_game_loop_error.rb
class GuessingGame
def initialize(answer)
@answer=answer;
@guess=guess;
@high=high;
@low=low;
@correct=correct;
@solved=solved;
end
#Define methods of guess, high, low, correct, solved
@jrosaaen
jrosaaen / guessing_game_correct_indentation.rb
Created February 15, 2014 23:35
guessing_game_correct_indentation.rb
class GuessingGame
def initialize(answer)
#Define methods of answer, guess, high, low, correct, solved
def answer
@@answer=answer
end
def guess
@@guess=guess.gets.to_i
end
def high(guess>answer) #Make method for high be set to guess being higher than answer