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
<!--- 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> |
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
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 |
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
#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; | |
} |
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
$:.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 |
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 Greeter | |
def initialize(name = "World") | |
@name = name | |
end | |
def say_hi | |
puts "Hi #{@name}!" | |
end | |
def say_bye |
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
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 |
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
# Controller | |
def index | |
@results = SexOffender.all | |
end | |
# View | |
<% if @results.blank? %> | |
<span>no sex offenders were found</span> |
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
// replaced this | |
$(document).ready(function() { | |
if ($.fn.corner) $('.corner').corner() | |
}) | |
// with this | |
.corner { | |
-moz-border-radius: 8px; | |
-webkit-border-radius: 8px; | |
border-radius: 8px; |
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 'rubygems' | |
require 'ghost' | |
module Productivity | |
BLOCK_LIST = %W{ facebook.com twitter.com } | |
def start | |
puts "Blocked:" | |
BLOCK_LIST.each do |host| | |
Host.add(host,'127.0.0.1') |
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
# previously required http://github.com/mislav/addressable | |
# with changes merged upstream, main repo should work too: | |
# http://github.com/sporkmonger/addressable/ | |
require 'addressable/template' | |
# http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0followers | |
template = Addressable::Template.new 'http://{host=twitter.com}' + | |
'/statuses/followers{-prefix|/|id}.{format=json}' + | |
'?{-join|&|user_id,screen_name,cursor}' |
OlderNewer