Skip to content

Instantly share code, notes, and snippets.

View sergii's full-sized avatar

Serhii Ponomarov sergii

View GitHub Profile
@sergii
sergii / log
Created July 12, 2011 21:27
Wednesday
Installed RVM:
$ sudo apt-get install git-core curl
Installed Ruby:
$ rvm install 1.9.2-p180
$ rvm use 1.9.2-p180
$ rvm gemset create prty_tv
$ rvm use 1.9.2-p180@prty_tv
Installed Rails:
$ gem install rails --pre
Created application:
@sergii
sergii / gist:6105745
Created July 29, 2013 16:49
rake db: Commands
rake db:create[:all]: If :all not specified then create the database defined in config/database.yml for the current RAILS_ENV. If :all is specified then create all of the databases defined in config/database.yml.
rake db:fixtures:load: Load fixtures into the current environment's database. Load specific fixtures using FIXTURES=x,y
rake db:migrate [VERSION=n]: Migrate the database through scripts in db/migrate. Target specific version with VERSION=n
rake db:migrate:redo [STEP=n]: (2.0.2) Revert the database by rolling back "STEP" number of VERSIONS and re-applying migrations.
rake db:migrate:reset: (2.0.2) Drop the database, create it and then re-apply all migrations. The considerations outlined in the note to rake db:create apply.
rake db:reset: Drop and re-create database using db/schema.rb. The considerations outlined in the note to rake db:create apply.
rake db:rollback [STEP=N]: (2.0.2) Revert migration 1 or n STEPs back.
rake db:schema:dump: Create a db/schema.rb file that can be portably used against an
@sergii
sergii / .bash_profile
Last active December 22, 2015 01:59
Some custom Po aliases
# some custom Po aliases
# folders
alias .='cd .'
alias ..='cd ..'
alias ...='cd ../..'
alias cdi='cd work/coalla/illustrator'
# rails
alias r='reset'
alias rs='rails server'
alias rrs='reset && rails server'
@sergii
sergii / .vimrc
Last active December 28, 2015 06:59
.vimrc
1 " Turn on line numbering. Turn it off with "set nonu"
2 set nu
3
4 " Set syntax on
5 syntax on
6
7 " Indent automatically depending on filetype
8 filetype indent on
9 set autoindent
10
@sergii
sergii / devise.ru.yml
Created December 18, 2013 20:54
Russian I18n locale for devise.
ru:
devise:
confirmations:
confirmed: "Ваша учётная запись подтверждена. Теперь вы вошли в систему."
send_instructions: "В течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи."
send_paranoid_instructions: "Если ваш адрес email есть в нашей базе данных, то в течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи."
failure:
already_authenticated: "Вы уже вошли в систему."
inactive: "Ваша учётная запись ещё не активирована."
invalid: "Неверный адрес email или пароль."
@sergii
sergii / ru.yml
Created December 18, 2013 21:02
ru.yml
ru:
date:
abbr_day_names:
- Вс
- Пн
- Вт
- Ср
- Чт
- Пт
- Сб
@sergii
sergii / install phantomjs
Created February 25, 2014 11:45
Install phantomjs on Ubuntu
This is exactly what I did.
cd /usr/local/share
wget http://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-x86_64.tar.bz2
tar xjf phantomjs-1.9.2-linux-x86_64.tar.bz2
sudo ln -s /usr/local/share/phantomjs-1.9.2-linux-x86_64/bin/phantomjs /usr/local/share/phantomjs
sudo ln -s /usr/local/share/phantomjs-1.9.2-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
sudo ln -s /usr/local/share/phantomjs-1.9.2-linux-x86_64/bin/phantomjs /usr/bin/phantomjs
And finally when I do
@sergii
sergii / Gemfile
Created March 4, 2014 12:03 — forked from Mikke/Gemfile
gem 'nokogiri'
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
/home/zzak/.rvm/gems/ruby-1.9.3-p0@whatever/gems/net-http-persistent-2.3.3/lib/net/http/persistent/ssl_reuse.rb:70:in `connect'
/home/zzak/.rvm/gems/ruby-1.9.3-p0@whatever/gems/net-http-persistent-2.3.3/lib/net/http/persistent/ssl_reuse.rb:70:in `block in connect'
/home/zzak/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
/home/zzak/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
/home/zzak/.rvm/gems/ruby-1.9.3-p0@whatever/gems/net-http-persistent-2.3.3/lib/net/http/persistent/ssl_reuse.rb:70:in `connect'
/home/zzak/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
/home/zzak/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:750:in `start'
/home/zzak/.rvm/gems/ruby-1.9.3-p0@whatever/gems/net-http-persistent-2.3.3/lib/net/http/persistent.rb:405:in `connection_for'
/home/zzak/.rvm/gems/ruby-1.9.