Skip to content

Instantly share code, notes, and snippets.

View tensiondriven's full-sized avatar

Jonathan Yankovich tensiondriven

View GitHub Profile

Homework for April 9th

  1. Write your first rails app
  • Create the Movies app using rails.
  • Start with the command:
    • rails new rails-movies
  1. Create your controller:
    • rails g controller movie
  1. Create ONE or TWO models, ie for movies and searches:
  • app/models/movie.rb - This is a class for a movie.
What is the best methodologies to follow to debug (e.g. using binding pry, splitting complex functions into multiple steps to see where the code is breaking, etc)?
How do we apply TDD more effectively? The TDD example seemed more of a Ruby logic exercise than a TDD exercise.
What is a good strategy for setting up your html when you get a webpage design, i.e. how do we set up our divs, layouts, etc."
"What's the best workflow to use in Git? For smaller teams, and for larger teams? How does the team workflow tie into Github? This is especially important if we're going to start creating group projects.
How can we best utilize Git to keep version control under, well, control?
# gem install --version 1.3.0 sinatra
require 'pry'
gem 'sinatra', '1.3.0'
require 'sinatra'
require 'sinatra/reloader'
require 'sqlite3'
get '/users' do
db = SQLite3::Database.new "store.sqlite3"
@tensiondriven
tensiondriven / gist:5272476
Created March 29, 2013 18:05
Friday Assignment
Programming Exersises
Write a program that
1
TODO List
Has a menu
Lets you enter a new task
Lets you mark a task as completed
Lets you list unfinished tasks
#!/usr/bin/env ruby
# -*- ruby -*-
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
class AboutAsserts < EdgeCase::Koan
# We shall contemplate truth by testing reality, via asserts.
def test_assert_truth
assert true # This should be true
def display_to_hundred
# range:
# print (1..100).to_a
# n = 0
# 100.times do
# n += 1
# puts n
# end
n = 0
class Rectangle < Object
@@num_rects = 0
attr_reader :width, :height
def initialize(width, height)
@width = width
@height = height
@@num_rects += 1
end
@tensiondriven
tensiondriven / gist:5201595
Created March 20, 2013 01:19
List of items
%table
%tr
%td
Startup Name
%td
Link
- @user.startups.each do |startup|
%tr
%td
= startup.startup_name
@tensiondriven
tensiondriven / gist:5144945
Created March 12, 2013 17:22
Last5 Cheers
"Just a quick note to tell you how much I like this system. I just happened on the IOS app yesterday. I am going to try the web system and see. I run a medical device company. A crucial issue is time management and corresponding productivity potential is how is time actually spent. Planned time is just that. But what counts is how does a person actually spent time."
<script>
$.ready(function() {
$('#species_guess').simpleTaxonSelector();
});
</script>
<div class="simpleTaxonSelector">
<input id="species_guess"/>
<input id="taxon_id" name="assessment[taxon_id]" type="hidden" />
</div>