Skip to content

Instantly share code, notes, and snippets.

View stefanpenner's full-sized avatar
🎯
Focusing

Stefan Penner stefanpenner

🎯
Focusing
View GitHub Profile
puts "Hello there, what's your name"
name = gets
puts "What's your middle name, #{name}"
mname = gets.chomp
puts "What's your last namme, #{name} #{mname}"
lname = gets.chome
puts "Wow, so your name is #{name} #{mname} #{lname}"
puts "What's your favorite number?"
number = gets.chomp.to_i
add= 1
class Greeter
def initialize(name = "World")
@name = name
end
def say_hi
puts "Hi #{@name}!"
end
def say_bye
$:.push "rails/activesupport/lib"
$:.push "rails/actionpack/lib"
require "action_controller"
class Kaigi < ActionController::Http
include AbstractController::Callbacks
include ActionController::RackConvenience
include ActionController::Renderer
include ActionController::Layouts
#p-cactions li {
border-top-left-radius: .5em;
border-top-right-radius: .5em;
-moz-border-radius-topleft: .5em;
-moz-border-radius-topright: .5em;
-webkit-border-top-left-radius: .5em;
-webkit-border-top-right-radius: .5em;
-khtml-border-top-left-radius: .5em;
-khtml-border-top-right-radius: .5em;
}
named_scope :bill_on, lambda { |*args|
date_to_bill = args[0]||Time.now.to_date
if date_to_bill.day < 27
{ :conditions => "DAY(billing_date) = #{date_to_bill.day}" }
else
offset = date_to_bill.end_of_month.day - date_to_bill.day
{ :conditions => "( DAY(LAST_DAY(CURRENT_DATE))-DAY(billing_date) ) = #{offset}" }
end
}
end
<!--- RENDERED PARTIAL >
<tr>
<td><%=h bug.user.company_name %> </td>
<td>Submitted by <%=h bug.submitter %></td>
<td><%=h bug.subject %> </td>
<td> <%=h truncate(bug.description.gsub(/<.*?>/,''), :length => 80) %> </td>
<td> <%= link_to 'Show', bug %> </td>
<% if session[:admin] %>
<td> <%= link_to 'Edit', edit_bug_path(bug)%> </td>