start new:
tmux
start new with session name:
tmux new -s myname
| -- Determine size of databases | |
| -- Source: http://stackoverflow.com/questions/1733507/how-to-get-size-of-mysql-database | |
| SELECT table_schema "DB Name", Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" | |
| FROM information_schema.tables | |
| GROUP BY table_schema; | |
| -- Size in MB of the innodb_buffer_pool_size. Default is 128 MB. | |
| -- More here: http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_buffer_pool_size | |
| SELECT @@innodb_buffer_pool_size / 1024 / 1024 |
| class Array | |
| def move(element, distance) | |
| current_pos = index(element) | |
| return self if current_pos.nil? | |
| new_pos = (current_pos+distance) - ((current_pos+distance)/length)*length | |
| delete(element) | |
| insert(new_pos, element) | |
| end | |
| end |
| IO.readlines("/usr/share/dict/words").map{|w| w.chomp}.select{|w| w.downcase.chars.sort.join == word.chars.sort.join}.reject{|w| w == word} |
| # invoices_controller.rb | |
| helper_method :available_filters | |
| def index | |
| @invoices = Invoice.send(filter_scope) | |
| end | |
| private | |
| def available_filters |
| [~/Projects/exercism]$ ruby ruby/rna-transcription/rna-transcription_test.rb | |
| Run options: --seed 51147 | |
| # Running tests: | |
| EEEEE | |
| Finished tests in 0.001201s, 4163.1973 tests/s, 0.0000 assertions/s. | |
| 1) Error: |
| # This allows stylesheets, scripts and images from the same origin host, but nothing else. | |
| Content-Security-Policy: default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' |
| # ~/.bashrc: executed by bash(1) for non-login shells. | |
| # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
| # for examples | |
| # If not running interactively, don't do anything | |
| case $- in | |
| *i*) ;; | |
| *) return;; | |
| esac |
| # Linux Primer | |
| ## Where am I? | |
| It can be intimidating when you are first confronted with prompt because you do not no where you are and what to do. This first section aims to help you orient yourself on any Linux system. | |
| ### The `pwd` command | |
| `pwd` |
Mint comes with a ruby package installed. It is installed as the root user and is not the latest version. We want the flexibility to install the latest version, to be able to easily upgrade and not have the hassles of installing gems as root.
To do this we need to use Ruby environment manager. This allows everyone on your team to be on the same version of Ruby, regardless of OS. This can be locked in with a .ruby-version in the root directory of your project.
I recommend rbenv to do this.
The software we're installing needs a few dependencies installed in order to work.