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 MyformBuilder < ActionView::Helpers::FormBuilder | |
| def self.create_tagged_field(method_name) | |
| define_method(method_name) do |name, *args| | |
| if object && object.errors.any? | |
| errors = object.errors.on(name.to_sym) | |
| errors = errors.join(', ') if errors.kind_of? Array | |
| end | |
| help = Help[object.class.to_s][name.to_s] if Help[object.class.to_s] | |
| # initialize some local variables |
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
| --- | |
| :benchmark: false | |
| :update_sources: true | |
| :sources: | |
| - http://gems.rubyforge.org | |
| - http://gems.github.com | |
| - http://gems.github.com | |
| gem: --no-ri --no-rdoc | |
| :bulk_threshold: 1000 | |
| :verbose: true |
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
| worker_processes 2; | |
| user root; | |
| error_log logs/error.log; | |
| #error_log logs/error.log notice; | |
| #error_log logs/error.log info; | |
| #pid logs/nginx.pid; | |
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
| <%o.fields_for :investments do |p|%> | |
| <%= p.select :amount, %w(25 50 75 100 200 500).collect{|a| "$#{a}"}, {}, {:class => :droplist}%> | |
| and here <%= amount%> display karayachi aahe | |
| <%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
| check process nginx with pidfile /opt/nginx/logs/nginx.pid | |
| start program = "/opt/nginx/sbin/nginx" | |
| stop program = "/opt/nginx/sbin/nginx -s stop" | |
| if cpu is greater than 70% for 3 cycles then alert | |
| if cpu > 80% for 5 cycles then restart | |
| if 10 restarts within 10 cycles then timeout | |
| check process sphinx with pidfile /home/josh/shared/pids/searchd.pid | |
| stop program = "/bin/bash -c 'cd /home/josh/current && /usr/bin/rake RAILS_ENV=production ts:stop'" | |
| start program = "/bin/bash -c 'cd /home/josh/current && /usr/bin/rake RAILS_ENV=production ts:start'" |
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
| #! /bin/sh | |
| set_path="cd /home/josh/current" | |
| case "$1" in | |
| start) | |
| echo -n "Starting delayed_job: " | |
| su - root -c "$set_path; RAILS_ENV=production script/delayed_job start" >> /var/log/delayed_job.log 2>&1 | |
| echo "done." | |
| ;; | |
| stop) |
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
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: monit | |
| # Required-Start: $remote_fs | |
| # Required-Stop: $remote_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: service and resource monitoring daemon | |
| ### END INIT INFO | |
| # chkconfig: 2345 56 10 |
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
| generators = [] | |
| puts 'Spinning up a new app, captain!' | |
| devise = yes?('Use Devise? (yes/no)') | |
| jquery = yes?('Use jQuery? (yes/no)') | |
| jquery_ui = yes?('Use jQuery UI? (yes/no)') if jquery | |
| mongoid = yes?('Use mongoid? (yes/no)') | |
| haml = yes?('Use haml? (yes/no)') | |
| rspec = yes?('Use Rspec? (yes/no)') |
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 group_li_formatting(collection, column_one, column_two, column_three, options = {}) | |
| html_attributes_options(options) | |
| li_default_options = {'data-role'=>"list-divider"} | |
| list = collection.collect do |created, post| | |
| tags = [content_tag("li", created, li_default_options)] | |
| tags += post.collect do |p| | |
| content_tag("li", "<h3>p.column_one</h3><p><strong>p.column_two</strong></p><p>p.column_three</p>".html_safe) | |
| 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
| heroku db:pull mysql://root@localhost/otz_production --app otz-production | |
| Loaded Taps v0.3.23 | |
| Warning: Data in the database 'mysql://root@localhost/otz_production' will be overwritten and will not be recoverable. | |
| ! WARNING: Potentially Destructive Action | |
| ! This command will affect the app: otz-production | |
| ! To proceed, type "otz-production" or re-run this command with --confirm otz-production | |
| > otz-production | |
| Receiving schema |
OlderNewer