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 pickup = { | |
| // Determine if the captcha is picked correctly | |
| if (params.captchaSelection != session.selectedCaptchaText) { | |
| // They selected the correct Captcha image. Continue with Authentication | |
| } else { | |
| flash.message = "You did not click the correct image below. Please Try Again." | |
| } |
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
| package com.example | |
| import org.springframework.web.servlet.support.RequestContextUtils as RCU | |
| class PagerTagLib { | |
| /** | |
| * Creates next/previous links to support pagination for the current controller | |
| * This is developed to avoid problems with the PostgreSQL count(*) bug. | |
| * http://sql-info.de/postgresql/postgres-gotchas.html#1_7 |
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
| class Lead { | |
| static hasMany = [ submissions: Submission ] | |
| Date dateCreated | |
| // ... | |
| } | |
| class Submission { | |
| static belongsTo = [ lead: Lead ] | |
| static hasMany = [ buyerLogs: BuyerLog ] | |
| Lead lead |
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
| SELECT count(l.id) | |
| FROM lead AS l, submission AS s, buyerLog as bl | |
| WHERE l.id = s.leadId | |
| AND s.id = bl.submissionId | |
| AND bl.leadBuyer = $buyerName | |
| AND l.id != $lead.id | |
| AND l.dateCreated::date > $daysAgo |
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
| /** | |
| * Count duplicate submissions within 45 days | |
| * SELECT count(l.id) | |
| * FROM lead AS l, submission AS s, buyerLog as bl | |
| * WHERE l.id = s.leadId | |
| * AND s.id = bl.submissionId | |
| * AND bl.leadBuyer = $buyerName | |
| * AND l.id != $lead.id | |
| * AND l.dateCreated::date > $daysAgo | |
| */ |
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
| require 'queue_manager' | |
| namespace :queue do | |
| desc 'Spawn multiple RabbitMQ consumer workers' | |
| task :workers => :environment do | |
| threads = [] | |
| queue_name = ENV['QUEUE'] | |
| num_workers = ENV['COUNT'] ||= '1' |
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
| require 'bunny' | |
| class QueueManager | |
| attr_reader :bunny, :bunny_exchange | |
| def initialize(settings) | |
| @bunny = Bunny.new(settings) | |
| @bunny.start | |
| @bunny_exchange = @bunny.exchange('', :durable => false) |
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
| # Add this to your test/test_helper.rb below `require 'test_help'` | |
| require 'minitest/autorun' | |
| # Change any tests you want to use the new syntax and filename | |
| lead_submissions_spec.rb | |
| # Example syntax for SPEC: | |
| require 'test_helper' | |
| describe LeadIntake::Core do |
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
Show hidden characters
| { | |
| // If translate_tabs_to_spaces is true, use_tab_stops will make tab and | |
| // backspace insert/delete up to the next tabstop | |
| "use_tab_stops": true, | |
| "extensions":["Gemfile", "Gemfile.lock", "Vagrantfile", "Thorfile"] | |
| } |
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
| Sublime Text 2 Shortcuts | |
| ⌘+r View methods or functions in a file. | |
| ⌃⇧⌘+f Distraction free editing | |
| ⌘⇧+k,b Toggle side panel | |
| ⌘⇧+p Command palette | |
| ⌘+d Select next occurrence of word | |
| ⌘⌃+g Select ALL occurrence of word | |
| ⌘⌃+a Auto align | |
| ⌘⌥⇧+2 Split screen |