Skip to content

Instantly share code, notes, and snippets.

View AleksandrKudashkin's full-sized avatar

Aleksandr Kudashkin AleksandrKudashkin

  • Montreal, Canada
View GitHub Profile
@AleksandrKudashkin
AleksandrKudashkin / passenger_standalone.rb
Created November 11, 2018 02:04 — forked from reu/passenger_standalone.rb
Capistrano recipe for passenger standalone
set :rails_env, "production"
set :passenger_port, 9292
set :passenger_cmd, "#{bundle_cmd} exec passenger"
namespace :deploy do
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && #{passenger_cmd} start -e #{rails_env} -p #{passenger_port} -d"
end
task :stop, :roles => :app, :except => { :no_release => true } do
@AleksandrKudashkin
AleksandrKudashkin / install-docker.sh
Created May 8, 2018 20:01 — forked from dweldon/install-docker.sh
Install docker CE on Linux Mint 18.3
#!/usr/bin/env bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt-get update
sudo apt-get install docker-ce
# https://docs.docker.com/compose/install/
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates -y
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo echo deb https://apt.dockerproject.org/repo ubuntu-xenial main >> /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get purge lxc-docker
sudo apt-get install linux-image-extra-$(uname -r) -y
sudo apt-get install docker-engine cgroup-lite apparmor -y
sudo usermod -a -G docker $USER
sudo service docker start
@AleksandrKudashkin
AleksandrKudashkin / gist:27decd870e1138796cf4892d8cb2d030
Created January 18, 2018 13:32 — forked from ezotrank/gist:3910281
Paperclip(ImageMagic) resize, crop and other action sheet cheat
'400x300' # resize, maintain aspect ratio
'400x300!' # force resize, don't maintain aspect ratio
'400x' # resize width, maintain aspect ratio
'x300' # resize height, maintain aspect ratio
'400x300>' # resize only if the image is larger than this
'400x300<' # resize only if the image is smaller than this
'50x50%' # resize width and height to 50%
'400x300^' # resize width, height to minimum 400,300, maintain aspect ratio
'2000@' # resize so max area in pixels is 2000
'400x300#' # resize, crop if necessary to maintain aspect ratio (centre gravity)
@AleksandrKudashkin
AleksandrKudashkin / install.sh
Created September 12, 2017 15:30 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@AleksandrKudashkin
AleksandrKudashkin / factory_doctor.rb
Created September 7, 2017 01:09 — forked from palkan/factory_doctor.rb
FactoryDoc: detect useless data generation in tests
module FactoryGirl
module Doctor
module FloatDuration
refine Float do
def duration
t = self
format("%02d:%02d.%03d", t / 60, t % 60, t.modulo(1) * 1000)
end
end
end