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 Result | |
| include Mongoid::Document | |
| include Mongoid::Timestamps | |
| FIELD_NAMES = [:persoonlijk, :versie, :brainstorm, :brainstorm_time] | |
| (1..80).each { |n| FIELD_NAMES << :"stroop_#{n}" } | |
| (1..6).each { |n| FIELD_NAMES << :"tekst_check_q#{n}" } | |
| (1..8).each { |n| FIELD_NAMES << :"likert-l#{n}" } | |
| (1..9).each { |n| FIELD_NAMES << :"likert-exit_b#{n}" } |
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
| syslogs = [ | |
| "/path/to/log/apache.5.gz", | |
| "/path/to/log/apache.1.gz", | |
| "/path/to/log/apache.10.gz", | |
| "/path/to/log/apache.256.gz" | |
| ] | |
| output = syslogs.collect do |file_name| | |
| file_name.match /(.*)\.(\d+)\.gz/ | |
| [$2.to_i, file_name] |
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
| maarten@web1:~/current$ sudo -u www-data GEM_HOME=/srv/rails/gems /srv/rails/nbb_production/app/current/script/delayed_job startsudo: sorry, you are not allowed to set the following environment variables: GEM_HOME | |
| maarten@web1:~/current$ sudo -u www-data GEM_HOME=/srv/rails/gems /srv/rails/nbb_production/app/current/script/delayed_job start | |
| sudo: sorry, you are not allowed to set the following environment variables: GEM_HOME | |
| maarten@web1:~/current$ export GEM_HOME=/srv/rails/gems | |
| maarten@web1:~/current$ sudo -u www-data /srv/rails/nbb_production/app/current/script/delayed_job start | |
| /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- bundler/setup (LoadError) | |
| from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require' | |
| from /srv/rails/nbb_production/app/current/script/delayed_job:4 |
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
| #!/usr/bin/env ruby | |
| STDOUT.sync=true | |
| CHECK_HOST = "google.nl" | |
| def check_connection | |
| system("ping #{CHECK_HOST} -c 5 1> /dev/null 2>/dev/null") | |
| return true if $? == 0 | |
| 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
| # Include the lib path in the load path | |
| lib = File.expand_path('../lib/', __FILE__) | |
| $:.unshift lib unless $:.include?(lib) |
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 "fast_helper" | |
| require "businessr/core/plugins" | |
| require "businessr/plugins" | |
| # => Both not needed because of the mocking of the plugin | |
| #require "businessr/core/plugin" | |
| #require "businessr/plugin" | |
| describe BusinessR::Core::Plugins 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
| $ time rspec spec/fast/core/plugins_spec.rb | |
| .. | |
| Finished in 0.00052 seconds | |
| 2 examples, 0 failures | |
| real 0m0.639s | |
| user 0m0.460s | |
| sys 0m0.130s |
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
| module Plugin::SupportTickets::UI | |
| include BusinessR::UI | |
| define :ui do | |
| main_menu_item "Customer" do | |
| menu_item "Support Tickets" do | |
| on_click :open_view => "List" | |
| menu_item "List all" { on_click :open_view => "List" } | |
| menu_item "Search" { on_click :open_view => "Search" } | |
| menu_item "New" { on_click :open_view => "New" } |
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
| module Plugin::SupportTickets::Models | |
| include BusinessR::Base::Models | |
| class Ticket < BaseModel | |
| configure do | |
| has :workflow | |
| has :optimistic_locking | |
| has :versions do |config| | |
| config.included_relations = [:posts] | |
| 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
| $ foreman start | |
| 00:55:15 web.1 | started with pid 24590 | |
| 00:55:15 worker.1 | started with pid 24591 | |
| 00:55:15 sphinx.1 | started with pid 24592 | |
| 00:55:35 worker.1 | [Worker(host:maarten-samsung pid:24594)] Starting job worker | |
| <more of this stuff> |