Skip to content

Instantly share code, notes, and snippets.

View g-ilham's full-sized avatar

g-Ilham g-ilham

  • Russian, Republic of Tatarstan, Kazan
View GitHub Profile
@g-ilham
g-ilham / devise erb to slim convert
Last active November 10, 2015 07:47
devise erb to slim convert
devise erb to slim convert
https://github.com/plataformatec/devise/wiki/How-To%3a-Create-Haml-and-Slim-Views
Create Slim views
We use a gem called 'html2slim' to create the Slim-views.
gem install html2slim
This package include a tool called erb2slim which can convert erb file to slim recursively. Option -d for delete the erb file after the convert finished.
@g-ilham
g-ilham / locales for devise russian
Last active August 29, 2015 14:05
locales for devise russian
locales for devise russian:
https://gist.github.com/EvilFaeton/5168083
@g-ilham
g-ilham / Capybara methods
Last active August 29, 2015 14:05
Capybara methods
https://gist.github.com/zhengjia/428105
https://gist.github.com/steveclarke/2353100
@g-ilham
g-ilham / Rvm comands
Last active August 29, 2015 14:05
Rvm comands
RVM comands
https://github.com/wayneeseguin/rvm
@g-ilham
g-ilham / therubyracer bug fix
Last active August 29, 2015 14:06
therubyracer bug fix
https://github.com/cowboyd/therubyracer/issues/274
@g-ilham
g-ilham / VPS install apt-get fails
Last active August 29, 2015 14:07
VPS install apt-get fails: E: Sub-process /usr/bin/dpkg returned an error code (1)
http://hellocoding.wordpress.com/2014/06/08/sub-process-usr-bin-dpkg-returned-error-1/
1
$ sudo apt-get remove install-info
Then run this command to clear apt archives:
1
$ sudo apt-get clean
Then finally run
1
@g-ilham
g-ilham / deploy to a VPS
Last active August 29, 2015 14:07
deploy to a VPS
http://www.eq8.eu/blogs/4-installing-rbenv-on-ubuntu-machine
sudo nano /etc/default/locale
Откроется текстовый редактор, и надо чтоб редактируемый файл выглядел так:
LANGUAGE=en_US.UTF-8
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
LC_TYPE=en_US.UTF-8
@g-ilham
g-ilham / Ubuntu added user or delete
Last active August 29, 2015 14:07
Ubuntu added user or delete
https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-ubuntu-12-04-and-centos-6
@g-ilham
g-ilham / Configuring database_cleaner
Created October 20, 2014 09:05
Configuring database_cleaner with Rails, RSpec, Capybara, and Selenium
http://devblog.avdi.org/2012/08/31/configuring-database_cleaner-with-rails-rspec-capybara-and-selenium/
@g-ilham
g-ilham / Rspec controllers with friendly_id
Last active August 29, 2015 14:09
Rspec controllers with friendly_id
**Rspec controllers with friendly_id**
============================
it '/:account_id/:project_id/edit to Projects#edit' do
path = edit_account_project_path 'foocorp', 'widgets'
path.should == '/foocorp/widgets/edit'
{ :get => path }.should route_to(
:controller => 'projects',
:action => 'edit',
:account_id => 'foocorp',
:id => 'widgets'