Mostafa Hussein Code-Vortex

View install PostgreSQL 9
1 2 3 4 5 6 7 8 9 10
install PostgreSQL 9 in Mac OSX via Homebrew
 
 
Mac OS X Snow Leopard
System Version: Mac OS X 10.6.5
Kernel Version: Darwin 10.5.0
 
 
Install notes for PostgreSQL 9.0.1 install using Homebrew:
sh-3.2# brew install postgresql
View series query for a chart by day.rb
1 2 3 4 5 6 7 8 9
first_day = Ticket.minimum(:created_at).to_date
last_day = Ticket.maximum(:created_at).to_date
all_tickets = Ticket.all # or Ticket.where(created_at: <from>..<to>)
 
count_by_day = (first_day..last_day).map do |day|
[ day, all_tickets.select{|t| t.created_at.to_date == day }.count ]
end
 
hash_version = Hash[ count_by_day ]
View mycode.js
1 2 3 4 5 6 7 8 9 10
jQuery ->
$('#counselor_supervisor_employee_position_id').hide()
position = $('#counselor_supervisor_employee_position_id').html()
$('#counselor_supervisor_employee_department_id').change ->
department = $('#counselor_supervisor_employee_department_id :selected').text()
escaped_department = department.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1')
options = $(position).filter("optgroup[label='#{escaped_department}']").html()
if options
$('#counselor_supervisor_employee_position_id').html(options)
$('#counselor_supervisor_employee_position_id').show()
Something went wrong with that request. Please try again.