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
| jQuery.fn.preventDoubleSubmission = function() { | |
| $(this).on('submit',function(e){ | |
| var $form = $(this); | |
| if ($form.data('submitted') === true) { | |
| e.preventDefault(); | |
| } else { | |
| $form.data('submitted', 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
| WARNING: Please be aware that you just installed a ruby that is no longer maintained (2014-02-23), for a list of maintained rubies visit: | |
| http://bugs.ruby-lang.org/projects/ruby/wiki/ReleaseEngineering | |
| Please consider upgrading to ruby-2.1.2 which will have all of the latest security patches. |
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
| # config/unicorn.rb | |
| worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) | |
| timeout 15 | |
| preload_app true | |
| before_fork do |server, worker| | |
| Signal.trap 'TERM' do | |
| puts 'Unicorn master intercepting TERM and sending myself QUIT instead' | |
| Process.kill 'QUIT', Process.pid | |
| 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
| @retained = [] | |
| @rand = Random.new(999) | |
| MAX_STRING_SIZE = 100 | |
| def stress(allocate_count, retain_count, chunk_size) | |
| chunk = [] | |
| while retain_count > 0 || allocate_count > 0 | |
| if retain_count == 0 || (@rand.rand < 0.5 && allocate_count > 0) | |
| chunk << " " * (@rand.rand * MAX_STRING_SIZE).to_i |
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
| namespace :admin do | |
| resources :users, only: [:show] do | |
| collection do | |
| get :search | |
| end | |
| end | |
| 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
| pt-BR: | |
| formtastic: | |
| :yes: 'Sim' | |
| :no: 'Não' | |
| :create: 'Criar %{model}' | |
| :update: 'Atualizar %{model}' | |
| :submit: 'Salvar %{model}' | |
| :cancel: 'Cancelar %{model}' | |
| :reset: 'Resetar %{model}' | |
| :required: 'obrigatório' |
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
| pt-BR: | |
| formtastic: | |
| :yes: 'Sim' | |
| :no: 'Não' | |
| :create: 'Criar %{model}' | |
| :update: 'Atualizar %{model}' | |
| :submit: 'Salvar %{model}' | |
| :cancel: 'Cancelar %{model}' | |
| :reset: 'Resetar %{model}' | |
| :required: 'obrigatório' |
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
| pg_dump -U user-name -d database-name -W > backup.sql | |
| scp user-name@server-address:path-to-file my-path |
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
| daemonize yes | |
| pidfile /var/run/redis.pid | |
| port 6379 | |
| tcp-backlog 511 | |
| bind 127.0.0.1 | |
| timeout 0 | |
| tcp-keepalive 0 | |
| loglevel notice | |
| logfile "/var/log/redis.log" | |
| databases 16 |
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 | |
| # | |
| # redis - this script starts and stops the redis-server daemon | |
| # | |
| # chkconfig: - 85 15 | |
| # description: Redis is a persistent key-value database | |
| # processname: redis-server | |
| # config: /etc/redis/redis.conf | |
| # config: /etc/sysconfig/redis | |
| # pidfile: /var/run/redis.pid |