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
if you want to list all currently running jobs from console, try this | |
```ruby | |
workers = Sidekiq::Workers.new | |
workers.each do |_process_id, _thread_id, work| | |
p work | |
end | |
``` | |
a work is a hash. |
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
# | |
deb http://nginx.org/packages/ubuntu/ precise nginx | |
deb http://apt.newrelic.com/debian/ newrelic non-free | |
# deb cdrom:[Ubuntu-Server 12.04 LTS _Precise Pangolin_ - Release amd64 (20120424.1)]/ dists/precise/main/binary-i386/ | |
# deb cdrom:[Ubuntu-Server 12.04 LTS _Precise Pangolin_ - Release amd64 (20120424.1)]/ dists/precise/restricted/binary-i386/ | |
# deb cdrom:[Ubuntu-Server 12.04 LTS _Precise Pangolin_ - Release amd64 (20120424.1)]/ precise main restricted | |
# deb cdrom:[Ubuntu-Server 12.04 LTS _Precise Pangolin_ - Release amd64 (20120424.1)]/ dists/precise/main/binary-i386/ | |
# deb cdrom:[Ubuntu-Server 12.04 LTS _Precise Pangolin_ - Release amd64 (20120424.1)]/ dists/precise/restricted/binary-i386/ | |
# deb cdrom:[Ubuntu-Server 12.04 LTS _Precise Pangolin_ - Release amd64 (20120424.1)]/ precise main restricted |
This file has been truncated, but you can view the full file.
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
Started GET "/sale_activity" for 127.0.0.1 at 2014-08-29 11:33:36 +0700 | |
Processing by ActivitiesController#sale_activity as HTML | |
User Load (1.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 4 LIMIT 1 | |
Setting Load (0.6ms) SELECT "settings".* FROM "settings" WHERE "settings"."key" = 'assessment_status_for_megt' LIMIT 1 | |
Setting Load (0.8ms) SELECT "settings".* FROM "settings" WHERE "settings"."key" = 'bdl_referrals' LIMIT 1 | |
SignupStatus Load (0.6ms) SELECT "signup_statuses".* FROM "signup_statuses" WHERE "signup_statuses"."code" = 'processing' LIMIT 1 | |
SignupStatus Load (0.3ms) SELECT "signup_statuses".* FROM "signup_statuses" WHERE "signup_statuses"."code" = 'pending' LIMIT 1 | |
CACHE (0.0ms) SELECT "signup_statuses".* FROM "signup_statuses" WHERE "signup_statuses"."code" = 'pending' LIMIT 1 | |
SignupSubStatus Load (1.4ms) SELECT "signup_sub_statuses".* FROM "signup_sub_statuses" WHERE "signup_sub_statuses"."name" = 'In Progress' AND "signup_sub_statuses"."signup_status_id" = 1 LIMIT 1 | |
C |
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
User Load (1.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 5 LIMIT 1 | |
Setting Load (0.8ms) SELECT "settings".* FROM "settings" WHERE "settings"."key" = 'assessment_status_for_megt' LIMIT 1 | |
Setting Load (0.6ms) SELECT "settings".* FROM "settings" WHERE "settings"."key" = 'bdl_referrals' LIMIT 1 | |
SignupStatus Load (0.7ms) SELECT "signup_statuses".* FROM "signup_statuses" WHERE "signup_statuses"."code" = 'processing' LIMIT 1 | |
SignupStatus Load (0.6ms) SELECT "signup_statuses".* FROM "signup_statuses" WHERE "signup_statuses"."code" = 'pending' LIMIT 1 | |
CACHE (0.0ms) SELECT "signup_statuses".* FROM "signup_statuses" WHERE "signup_statuses"."code" = 'pending' LIMIT 1 | |
SignupSubStatus Load (0.7ms) SELECT "signup_sub_statuses".* FROM "signup_sub_statuses" WHERE "signup_sub_statuses"."name" = 'In Progress' AND "signup_sub_statuses"."signup_status_id" = 1 LIMIT 1 | |
CACHE (0.0ms) SELECT "signup_statuses".* FROM "signup_statuses" WHERE "signup_statuses"."code" = 'pending' LIMIT 1 | |
SignupSubStat |
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
chmod 1777 /tmp | |
service postgresql start |
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 SmartTableSetting | |
constructor: (form) -> | |
@form = $(form) | |
@columns = @form.find('.column') | |
@columns.sortable | |
activate: (event, ui) => | |
event.preventDefault | |
$(this).css "background-color", "#CFCFCF" |
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
rails g model ABC status:string | |
rake db:migrate | |
class Abc < ActiveRecord::Base | |
before_create :set_status | |
private | |
def set_status | |
status = 'Test' |
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 LetterImport < CSVImport | |
def import(row) | |
letter = Letter.where(template_name: row[:letter_name]).first_or_initialize | |
params = { | |
content: row[:letter_text] | |
} | |
if letter.new_record? | |
params[:created_by] = User.jobready.first |
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
- signup_project.rb | |
scope :by_creator, -> (user) { where(created_by: user.id) } | |
- widgets/_signup_in_progres.html.haml | |
= widget 'signups_in_progress' do | |
%h4 #{icon('file-text')} Signup Projects In Progress (#{SignupProject.by_creator(current_user).count}) |
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
* if is standard recommencement | |
if recommencement date >= 01/07/2012 | |
+ if startdate <= 01/07/2012 | |
recommencementdate + 3.months | |
+ if startdate > 01/07/2012 | |
recommencementdate + 6.months | |
NewerOlder