Skip to content

Instantly share code, notes, and snippets.

View FrancoB411's full-sized avatar

Franco Barbeite FrancoB411

View GitHub Profile
@FrancoB411
FrancoB411 / Gemfile
Created December 22, 2010 02:15
The Gemfile in Question
source 'http://rubygems.org'
# gem 'rails', '3.0.0'
gem 'rails', '3.0.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3-ruby', :require => 'sqlite3'
@FrancoB411
FrancoB411 / Gemfile.lock
Created December 22, 2010 02:18
The .lock file
GEM
remote: http://rubygems.org/
specs:
ZenTest (4.4.2)
abstract (1.0.0)
actionmailer (3.0.3)
actionpack (= 3.0.3)
mail (~> 2.2.9)
actionpack (3.0.3)
activemodel (= 3.0.3)
@FrancoB411
FrancoB411 / Gemfile.lock2
Created December 22, 2010 02:26
After Bundle Install
GEM
remote: http://rubygems.org/
specs:
ZenTest (4.4.2)
abstract (1.0.0)
actionmailer (3.0.3)
actionpack (= 3.0.3)
mail (~> 2.2.9)
actionpack (3.0.3)
activemodel (= 3.0.3)
@FrancoB411
FrancoB411 / Lessons View
Created December 22, 2010 04:28
Lessons View See div class="bookmarklet"
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>memofire_lessons</title>
<!--Working Master CSS to Validate-->
<%= stylesheet_link_tag 'shared_styles',
'lessons'
%>
</head>
class ObjectPrinter
#changed param name to item so it's clearer we're sticking an "item" in there and not the class "ObjectPrinter" itself
def print_methods(item)
#added a little space and header to make it easier to read
3.times {puts ""}
puts "#{item} methods:"
puts "----------------------------"
puts ""
class Piano
attr_accessor :brand, :age, :power
def initialize
@brand = "steinway"
@age = 10
@power = 0
end
@FrancoB411
FrancoB411 / number_guesser.rb
Created May 26, 2011 14:21
number_guesser.rb
MAX_NUMBER = 50
MIN_NUMBER = 0
GUESS_LIMIT = 5
@computers_number = rand(MAX_NUMBER - MIN_NUMBER + 1) + MIN_NUMBER
def over_guess_limit?
if @guess_count > GUESS_LIMIT
puts "You're over the guess limit!"
true
end
@FrancoB411
FrancoB411 / TimeClass.rb
Created June 10, 2011 05:35
Modifying Fixnum Class to make playing with time easier
class Fixnum
def seconds
self
end
def minutes
self * 60
end
@FrancoB411
FrancoB411 / analyzer.rb
Created June 27, 2011 13:39
Text Analyzer from Beginning Ruby
#analyzer.rb -- Text Analyzer
stopwords = %w{the a by on for of are with just but and to the my I has some in}
lines = File.readlines(ARGV[0])
line_count = lines.size
text = lines.join
#count the characters
character_count = text.length
@FrancoB411
FrancoB411 / counter
Created December 13, 2011 06:57
Simple Javascript Counter
<html>
<head>
<script type="text/javascript">
var c=0;
var t;
var timer_is_on=0;
function timedCount()
{
document.getElementById('txt').value=c;