This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def display_to_hundred | |
# range: | |
# print (1..100).to_a | |
# n = 0 | |
# 100.times do | |
# n += 1 | |
# puts n | |
# end | |
n = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Rectangle < Object | |
@@num_rects = 0 | |
attr_reader :width, :height | |
def initialize(width, height) | |
@width = width | |
@height = height | |
@@num_rects += 1 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%table | |
%tr | |
%td | |
Startup Name | |
%td | |
Link | |
- @user.startups.each do |startup| | |
%tr | |
%td | |
= startup.startup_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new_user_session GET /users/sign_in(.:format) devise/sessions#new | |
user_session POST /users/sign_in(.:format) devise/sessions#create | |
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy | |
user_omniauth_authorize /users/auth/:provider(.:format) devise/omniauth_callbacks#passthru {:provider=>/(?!)/} | |
user_omniauth_callback /users/auth/:action/callback(.:format) devise/omniauth_callbacks#(?-mix:(?!)) | |
user_password POST /users/password(.:format) devise/passwords#create | |
new_user_password GET /users/password/new(.:format) devise/passwords#new | |
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit | |
PUT /users/password(.:format) devise/passwords#update | |
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks"} | |
devise_scope :user do | |
get '/users/auth/facebook' => 'users/omniauth_callbacks#facebook' | |
end | |