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
!.*/(\.[^/]*|tmp|documents|index|public/images|vendor/rails|vendor/.*/test|vendor/.*/tests|doc|rails_root|CVS|log|data_dump|build|_darcs|pkg |_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)? |bundle))$ |
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
calendar({:year => Date.today.year, :month => Date.today.month, :first_day_of_week => 1}) do |d| | |
cell_text = "#{d.mday}<br />" | |
cell_attrs = {:class => 'day'} | |
@incompleted_tasks.each do |task| | |
if task.deadline == d | |
cell_text << link_to(task.name, project_task_path(@project.id, task.id)) << "<br />" | |
if task.deadline < Date.today | |
cell_attrs[:class] = 'specialDayLated' | |
else | |
cell_attrs[:class] = 'specialDay' |
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
MemCheck: -1068 [173680-174748]: Exchange#index (pid=25657) | |
MemCheck: -1068 [173680-174748]: Exchange#index (pid=26142) | |
MemCheck: 0 [175772-175772]: Exchange#index (pid=26142) | |
MemCheck: 0 [175772-175772]: Exchange#index (pid=26142) | |
MemCheck: -68 [175772-175840]: Exchange#create (pid=26142) | |
MemCheck: 0 [175840-175840]: Exchange#index (pid=26142) | |
MemCheck: 0 [175840-175840]: SupplierProducts#set_new_prices (pid=26142) | |
MemCheck: -1068 [173680-174748]: Exchange#index (pid=27224) | |
MemCheck: 0 [175772-175772]: Exchange#index (pid=27224) | |
MemCheck: -68 [175772-175840]: Exchange#create (pid=27224) |
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
span_trans = lambda do |el| | |
if el[:node].name == "span" | |
if el[:node].has_attribute?("style") | |
rules = el[:node].attribute("style").value.split(";") | |
new_rules = rules.map do |rule| | |
rule.match(/text-decoration:\s*(underline|overline|line-through)\b/) || | |
rule.match(/font-weight:\s*bold\b/) || | |
rule.match(/font-style:\s*italic\b/) | |
end | |
new_style = new_rules.compact.map{|r| r.to_s}.join("; ") |
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 User < ActiveRecord::Base | |
# gradual engagement is needed, to allow admin creation of users | |
# users should create authorization data only when they need to | |
# access some system feature that requires authentication | |
# So ... our gradual engagement scheme for authlogic: | |
# 1. admin creates user, setting only name and phone number (required) | |
# admin may set email address (optional) | |
# 2. user is sent email invitation with link to activate their account | |
# admin can re-send email at user's request | |
# 3. user sets login and password/password_confirmation using activation form |
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 'eventmachine' | |
require 'em-websocket' | |
require 'json' | |
class Connection | |
attr_accessor :socket, :user_id | |
def initialize(socket, user_id) | |
@socket = socket |
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
<message type='chat' id='purple3475c67' to='jaconda@jaconda.im'> | |
<active xmlns='http://jabber.org/protocol/chatstates'/> | |
<body>link text <http://google.com?a=1&amp;b=2></body> | |
<html xmlns='http://jabber.org/protocol/xhtml-im'> | |
<body xmlns='http://www.w3.org/1999/xhtml'><p><a href='http://google.com?a=1&b=2'>link text</a></p></body> | |
</html> | |
</message> |
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
<message type='chat' id='purple3475c67' to='jaconda@jaconda.im'> | |
<active xmlns='http://jabber.org/protocol/chatstates'/> | |
<body>link text <http://google.com?a=1&amp;b=2></body> | |
<html xmlns='http://jabber.org/protocol/xhtml-im'> | |
<body xmlns='http://www.w3.org/1999/xhtml'><p><a href='http://google.com?a=1&amp;b=2'>link text</a></p></body> | |
</html> | |
</message> |
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 Rack | |
class Request | |
def scheme | |
if @env['HTTPS'] == 'on' | |
'https' | |
elsif @env['HTTP_X_FORWARDED_SSL'] == 'on' | |
'https' | |
elsif @env['HTTP_X_FORWARDED_PROTO'] | |
@env['HTTP_X_FORWARDED_PROTO'].split(',')[0] | |
else |
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 DBI | |
class Row | |
# | |
# See Object#clone. | |
# | |
# #clone here, however, is a deep copy via Marshal. | |
# | |
def clone | |
Marshal.load(Marshal.dump(self)) | |
end |
OlderNewer