This file contains hidden or 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
| ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux] | |
| irb(main):002:0> [[{"id" => 102}], {"id" => 102}].flatten.uniq | |
| => [{"id"=>102}, {"id"=>102}] | |
| ruby 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0] | |
| >> [[{"id" => 102}], {"id" => 102}].flatten.uniq | |
| => [{"id"=>102}] | |
| WTF? |
This file contains hidden or 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
| {"json"=>"{\"first_name\":\"Allen\",\"uid\":\"670831017\",\"session_id\":\"3866d66d26dc80ab01f5b4ab-670831017\",\"last_name\":\"Hujsak\",\"pic_square\":\"http://missionvi.code-examples.net/proxy.php?url=http%3A//profile.ak.fbcdn.net/v228/1407/76/q670831017_1549.jpg&mimeType=image/jpeg\",\"email\":\"apps+271382725889.670831017.aa221e0e5f9be134154f36bec0140073@proxymail.facebook.com\"}"} |
This file contains hidden or 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
| Project.find_by_sql('select * from projects where featured = 1 and public = 1 and recent = 1 order by RAND() limit 1')[0] |
This file contains hidden or 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
| case org_type.name | |
| when 'A' | |
| if public_link == false | |
| html << sidebar_link(newsletter.get_messages_title(Organization.find(org_id[org_type.name])), | |
| organization_newsletter_messages_url(organization, newsletter, :org_type => 'A')) if !html.include?('A') | |
| else | |
| html << sidebar_link(newsletter.get_messages_title(Organization.find(org_id[org_type.name])), | |
| public_newsletter_messages_url(newsletter, :org_type => 'A', :section_type => 'message')) if !html.include?('A') | |
| end | |
| when 'B' |
This file contains hidden or 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
| <% if @panel1_product.max_qty > 0 && @panel1_product.remaining < 20 && @panel1_product.available? %> | |
| <% if @panel1_product.remaining == 1 %> | |
| <p class="remaining"><%= @panel1_product.remaining %> item left!</p> | |
| <% else %> | |
| <p class="remaining"><%= @panel1_product.remaining %> items left!</p> | |
| <% end %> | |
| <% end %> |
This file contains hidden or 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
| def active? | |
| today = Time.now.strftime('%Y-%m-%d %H:%M') | |
| today >= self.begin_date.strftime('%Y-%m-%d 06:00') && today <= self.end_date.strftime('%Y-%m-%d 23:59') | |
| end |
This file contains hidden or 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
| namespace :ci do | |
| Rake.application.remove_task("ci:run") | |
| task :run do | |
| Rake::Task["spec"].invoke | |
| end | |
| end |
This file contains hidden or 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
| # KEEP PRACTICE | |
| hack = current_account.users.find_by_email(params[:user_session][:login]) |
This file contains hidden or 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
| And I should receive an email #features/step_definitions/email_steps.rb:51 | |
| undefined method `unread_emails_for' for #<ActionController::Integration::Session:0x102aea080> (NoMethodError) | |
| ./features/step_definitions/email_steps.rb:52:in `/^(?:I|they|"([^"]*?)") should receive (an|no|\d+) emails?$/' | |
| features/user_signup.feature:20:in `And I should receive an email' | |
| ============== |
This file contains hidden or 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
| +----------------------+-------+-------+---------+---------+-----+-------+ | |
| | Name | Lines | LOC | Classes | Methods | M/C | LOC/M | | |
| +----------------------+-------+-------+---------+---------+-----+-------+ | |
| | Controllers | 1462 | 1189 | 49 | 200 | 4 | 3 | | |
| | Helpers | 535 | 413 | 0 | 39 | 0 | 8 | | |
| | Models | 2641 | 2004 | 67 | 267 | 3 | 5 | | |
| | Libraries | 1320 | 992 | 9 | 132 | 14 | 5 | | |
| | Model specs | 5554 | 4309 | 0 | 5 | 0 | 859 | | |
| | View specs | 0 | 0 | 0 | 0 | 0 | 0 | | |
| | Controller specs | 2866 | 2230 | 2 | 25 | 12 | 87 | |