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
module Codebreaker | |
class Game | |
def initialize(output) | |
@output = output | |
end | |
def start(secret) | |
@secret = secret | |
@output.puts 'Welcome to Codebreaker!' | |
@output.puts 'Enter guess:' |
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
#Remember to get the proper gems on your gem file: | |
# gem 'database_cleaner', '>= 0.5.2' | |
# gem 'selenium-client', '>= 1.2.18' | |
# then: bundle install | |
#Step 1 for using Selenium. This goes after ActionContoller allow_resque line /Americo | |
Cucumber::Rails::World.use_transactional_fixtures = false | |
#Step 2 for using Selenium This goes at the bottom of the file /Americo | |
class ActiveSupport::TestCase |
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
Set Repo | |
$ git init | |
Add all files/folders | |
$ git add . | |
Push up code | |
$ git remote add origin [email protected]:<username>/app_name.git | |
$ git push origin master |
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
Create a new app at Heroku | |
$ heroku create | |
Heroku deployment | |
$ git push heroku master | |
To deploy your Database (you need to use taps gem: $ gem install taps) | |
$ heroku db:push | |
Open Heroku app |
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
1) Add gems to gemfile | |
gem 'rails', '3.0.0' | |
gem 'sqlite3-ruby', :require => 'sqlite3' | |
group :development, :test do | |
gem 'rspec-rails', '>= 2.0.0' | |
gem 'cucumber-rails', '>= 0.3.2' | |
#gem 'webrat', '>= 0.7.2' | |
gem 'capybara', '0.4.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
# This is the documentation for Person | |
#### Person Class | |
class Person | |
# Age variable of Class Person | |
age = "21" | |
# Sample method to say Hello | |
def self.say_hello | |
puts("Hello there!") |
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
<html> | |
<head> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
$("#csv_form").submit(function(event) { | |
event.preventDefault(); |
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
require 'formula' | |
class Libstemmer < Formula | |
# upstream is constantly changing the tarball, | |
# so doing checksum verification here would require | |
# constant, rapid updates to this formula. | |
head 'http://snowball.tartarus.org/dist/libstemmer_c.tgz' | |
homepage 'http://snowball.tartarus.org/' | |
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
require 'youtube_it' | |
USER = "YOUTUBE_USER_NAME" | |
PASS = "YOUTUBE_PASS" | |
DEV_KEY = "YOUTUBE_DEV_KEY" | |
##Upload a video | |
uploader = YouTubeIt::Upload::VideoUpload.new( | |
:username => USER, | |
:password => PASS, |
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
<%= form_for @video, :url => {:action => (@video.new_record? ? 'name_video' : 'update'), | |
:id => (@video.new_record? ? nil : @video)} do |f| %> | |
<div id='columnForm'> | |
<fieldset> | |
<legend> | |
Video Information | |
</legend> | |
<label for="source_code">Video Source: | |
<%= f.collection_select('video_source_id', |
OlderNewer