Skip to content

Instantly share code, notes, and snippets.

View sseletskyy's full-sized avatar
🍊
FP mood

Sergiy Seletskyy sseletskyy

🍊
FP mood
View GitHub Profile
@sseletskyy
sseletskyy / erb2slim
Created February 8, 2014 07:50
how to convert html to slim
>gem install html2slim
in case of using .rbenv don't forget to set path in bash_profile
>> PATH=${PATH}:~/.rbenv/versions/2.0.0-p353/bin/
>for file in app/views/devise/**/*.erb; do erb2slim $file ${file%erb}slim && rm $file; done
# Deploy and rollback script for Heroku on staging and/or production
# Modified from: https://gist.github.com/njvitto/362873
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
desc 'Deploy to Staging on Heroku'
task :staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
desc 'Deploy to Production on Heroku'
describe ArticlesController do
describe "inactive article" do
let(:article) { double(:article, active?: false, id: 1) }
before(:each) do
allow(Article).to receive(:find) { article }
end
=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')
@sseletskyy
sseletskyy / deploy.rake
Last active December 15, 2015 21:40 — forked from jphenow/deploy.rake
improved heroku deploy rake task
#Deploy and rollback on Heroku in staging, production, dev and test environments
require 'tempfile'
# for capturing error in 'git push'
def capture_stderr
stderr = $stderr.dup
Tempfile.open 'stderr-redirect' do |temp|
$stderr.reopen temp.path, 'w+'
yield if block_given?
@sseletskyy
sseletskyy / new_gist_file
Created June 30, 2013 21:45
Create a new rails project with Rails Composer (https://github.com/RailsApps/rails-composer/)
rails new trackonrails -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb
@sseletskyy
sseletskyy / text shadow
Created June 30, 2013 21:04
nice shadow for black text on white
text-shadow: 0 1px 3px rgba(0,0,0,.4), 0 0 30px rgba(0,0,0,.075);
@sseletskyy
sseletskyy / new_gist_file
Created June 30, 2013 21:42
Useful article about new features of Rails 4 and some other tasty links to other resources
http://habrahabr.ru/company/engineyard/blog/170473/
@sseletskyy
sseletskyy / new_gist_file
Created June 30, 2013 21:47
Foundation Zurb
http://foundation.zurb.com/
@sseletskyy
sseletskyy / new_gist_file
Created June 30, 2013 21:49
Recommendations for a Rails tutorial
https://tutorials.railsapps.org/rails-tutorial