Skip to content

Instantly share code, notes, and snippets.

View dladowitz's full-sized avatar

David Ladowitz dladowitz

View GitHub Profile
require 'docopt'
class Todo
def initialize
puts "Generating 'To Do' list"
@file = File.open("todo_list.txt", 'w+')
puts "'To Do' list generated"
end
@dladowitz
dladowitz / todo.rb
Created June 24, 2012 07:46
ToDo App
require 'docopt'
#-------------------------------------------------------
class List
# attr_accessor :all_tasks
def initialize
@all_tasks = []
@dladowitz
dladowitz / todo_spec.rb
Created June 28, 2012 00:15
Rspec for Jesse's ToDo app
# require 'spec_helper'
require 'simplecov'
SimpleCov.start
require './list'
require './todo'
require './task'
describe Todo::List do
@dladowitz
dladowitz / InWords.html
Created June 28, 2012 06:16
Numbers to words (up to 99) in Javascript
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
</head>
<body>
@dladowitz
dladowitz / InWords
Created June 28, 2012 06:17
Numbers to Words (up to 999) in ruby
module InWords
def in_words
ones = {
1 => "one",
2 => "two",
3 => "three",
4 => "four",
5 => "five",
@dladowitz
dladowitz / list.rb
Created June 29, 2012 01:12
Todo code for Shereef's list_spec.rb
# uses spec files from: https://github.com/devbootcamp/todo/tree/tests
require './task.rb'
class List
def initialize(file_name)
@list = IO.readlines(file_name)
# puts @list[0].class
# puts @list.length
# @list = [1,2,3]
@dladowitz
dladowitz / task.rb
Created June 29, 2012 01:14
ToDo app for Shereef's task_spec.rb
# Uses spec files from: https://github.com/devbootcamp/todo/tree/tests
class Task
def initialize(task_name, date_created = Time.now, date_completed = nil)
@task = task_name
@date_created = date_created
@date_completed = date_completed
@dladowitz
dladowitz / todo.xml
Created July 3, 2012 18:49
Todo Table XML
<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ -->
<!-- Active URL: http://socrates.devbootcamp.com/sql.html -->
<sql>
<datatypes db="mysql">
<group label="Numeric" color="rgb(238,238,170)">
<type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/>
<type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/>
<type label="Single precision" length="0" sql="FLOAT" quote=""/>
<type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/>
@dladowitz
dladowitz / assesment_1_Javascript.js
Created July 7, 2012 05:12
Javascript Assesement 1
// David Ladowitz
// start time: 8:00pm
// Exercise 1....................................................
var newConcat = function(first, last){
return (first + last)
};
newConcat('david', 'ladowitz')
@dladowitz
dladowitz / student2.rb
Created July 17, 2012 00:19
Active Record Tests
require 'active_record'
require 'sqlite3'
ActiveRecord::Base.establish_connection :adapter => 'sqlite3',
:database => 'db/students.db'
ActiveRecord::Base.connection.execute <<SQL
CREATE TABLE IF NOT EXISTS students (
id INTEGER PRIMARY KEY AUTOINCREMENT,
first_name VARCHAR NOT NULL,
last_name VARCHAR NOT NULL,
birthday DATE,