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
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script>window.jQuery || document.write("<script src='js/libs/jquery-1.7.2.min.js'>\x3C/script>")</script> |
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
def save_file_details(file) | |
model.document_original = file.original_filename if file.respond_to?(:original_filename) | |
fields = {:document_type => file.content_type, :document_size => file.size} | |
fields.each do |field, value| | |
if model.has_attribute? field | |
model.send("#{field}=", value) | |
end | |
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
SELECT Team.name, User.name, CR.week, CR.id, Team.id, User.id | |
FROM consultant_reports as CR | |
JOIN teams AS Team ON (CR.team_id = Team.id) | |
JOIN admin_users AS User ON (CR.admin_user_id = User.id) | |
WHERE CR.month = %s | |
%s | |
GROUP BY Team.name, User.name, CR.week | |
ORDER BY Team.name, User.name, CR.week; |
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
def self.reports(current_user) | |
select_fields = %w[ | |
consultant_reports.id consultant_reports.week | |
teams.id teams.name admin_users.id admin_users.name | |
] | |
group_fields = %w[ teams.name admin_users.name consultant_reports.week ] | |
data = joins(:team, :admin_user).select(select_fields).group(group_fields) | |
current_user.has_role?(:consultant) ? | |
data.where('teams.admin_user_id = ?', current_user.id) : data | |
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
# File: dnotifier.conf | |
# Author: Donovan du Plessis | |
# Description: dnotifier upstart configuration | |
# Last Modified: August 30, 2012 | |
description "dnotifier service to generate thumbnails for uploaded images" | |
author "Donovan du Plessis <donovan@binarytrooper.com>" | |
# When to start the service | |
start on (net-device-up |
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
@reports_list = ConsultantReport.reports_list(current_admin_user) | |
@reports = {} | |
@reports_list.each_with_index do |report, index| | |
team = report.team.name | |
user = report.admin_user.name | |
@reports[team] = {} unless @reports.include?(team) | |
@reports[team][user] = [] unless @reports[team].include?(user) | |
@reports[team][user] << [report.week.to_s, report.id] 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
'cvlog-query' => | |
"SELECT IFNULL(Division.name,'Unknown Division') AS did, | |
IFNULL(User.name,'Unknown User') AS uid, division_id, user_id, | |
count(*) as today, null as twoweeks, null as archive | |
FROM cvlogs as Cvlog | |
LEFT JOIN divisions AS Division ON (Cvlog.division_id = Division.id) | |
LEFT JOIN users AS User ON (Cvlog.user_id = User.id) | |
WHERE DATE(Cvlog.date) = CURDATE() | |
GROUP BY division_id, user_id", | |
'cvlog-archive-query' => |
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
# Sample verbose configuration file for Unicorn (not Rack) | |
# | |
# This configuration file documents many features of Unicorn | |
# that may not be needed for some applications. See | |
# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb | |
# for a much simpler configuration file. | |
# | |
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete | |
# documentation. |
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
# Sample verbose configuration file for Unicorn (not Rack) | |
# | |
# This configuration file documents many features of Unicorn | |
# that may not be needed for some applications. See | |
# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb | |
# for a much simpler configuration file. | |
# | |
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete | |
# documentation. |
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
# File: deploy.rb | |
# Author: Donovan du Plessis | |
# Description: Capistrano Deployment Automation | |
# Last Modified: May 17, 2012 | |
default_run_options[:pty] = true | |
set :application, "pwnurl" | |
set :repository, "ssh://donovan@pwnurl.com/~/hireresolve.intranet.git" |
OlderNewer