h1 Hello world!
для локализации заменяем текст на ключ 'hello' и отдаем его в функцию t
h1 =t('hello')
и записываем ключ с соответствующим ему текстом в config/locales/en.yml
| [Unit] | |
| Description=Puma Rails Server | |
| After=network.target | |
| [Service] | |
| Type=simple | |
| User=deploy | |
| WorkingDirectory=/home/deploy/app/current | |
| ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/app/shared/config/puma.rb | |
| ExecStop=/home/deploy/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/deploy/app/shared/tmp/pids/puma.state stop |
| RSpec.configure do |config| | |
| config.before(:suite) do | |
| DatabaseCleaner.clean_with(:truncation) | |
| end | |
| config.before(:each) do | |
| DatabaseCleaner.strategy = :transaction | |
| end | |
| config.before(:each, js: true) do |
| module ActiveRecord | |
| module RailsAdminEnum | |
| def enum(definitions) | |
| super | |
| definitions.each do |name, values| | |
| define_method("#{ name }_enum") { self.class.send(name.to_s.pluralize).to_a } | |
| define_method("#{ name }=") do |value| | |
| if value.kind_of?(String) and value.to_i.to_s == value |
| namespace :figaro do | |
| desc "SCP transfer figaro configuration to the shared folder" | |
| task :setup do | |
| on roles(:app) do | |
| upload! "config/application.yml", "#{shared_path}/application.yml", via: :scp | |
| end | |
| end | |
| desc "Symlink application.yml to the release path" | |
| task :symlink do |
| sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev | |
| #install rbenv | |
| #install ruby-build | |
| #install ruby via rbenv | |
| #install bundler | |
| sudo apt-get install postgresql postgresql-contrib libpq-dev | |
| # sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev |
GNU Octave is a high-level interpreted language, primarily intended for numerical computations.
(via GNU Octave)
~=&&| tcpdump | |
| lsof - show all opened descriptors | |
| top - show how much user and system time current processes are using | |
| strace - show all syscalls called by the application | |
| iostat - report io statistics | |
| netstat - show all opened network connections | |
| limits.conf - set limits to users | |
| ulimit | |
| sysctl - configure kernel parameters | |
| pstack - print stack trace of running process |
| -module(index). | |
| -export([get_file_contents/1,show_file_contents/1, index/1]). | |
| % Used to read a file into a list of lines. | |
| % Example files available in: | |
| % gettysburg-address.txt (short) | |
| % dickens-christmas.txt (long) | |
| index(Name) -> | |
| Words = words(get_file_contents(Name)), | |
| lists:filter(fun({W, _}) -> length(W) >= 3 end, lists:sort(fun({W1, _}, {W2, _}) -> W1 < W2 end, index_from_words(Words))). |
| sudo apt-get update | |
| sudo locale-gen "en_US.UTF-8" | |
| in /etc/default/locale: | |
| LC_ALL=en_US.UTF-8 | |
| LANG=en_US.UTF-8 | |
| sudo apt-get install git-core build-essential libssl-dev libreadline-dev zlib1g-dev nodejs postgresql libxml2-dev libxslt1-dev | |
| postgresql-server-dev-9.3 curl python-software-properties libcurl4-openssl-dev | |
| git clone https://github.com/rbenv/rbenv.git ~/.rbenv | |
| echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
| echo 'eval "$(rbenv init -)"' >> ~/.bashrc |