Skip to content

Instantly share code, notes, and snippets.

@duleorlovic
duleorlovic / YoutubeDownloader.md
Created May 26, 2017 13:32 — forked from sheharyarn/YoutubeDownloader.md
Download Videos from Youtube in (Ruby || PHP)

Youtube Downloaders

Download Youtube Videos using Ruby or PHP

Just copy the appropriate script, provide the video_id and run. It will list download links for different qualities and streams.

:P

@duleorlovic
duleorlovic / capybara cheat sheet
Created November 25, 2015 21:51 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=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')
@duleorlovic
duleorlovic / linkable.rb
Last active April 1, 2020 19:48
Linkable concern instead of friendly_id gem
# app/models/concerns/linkable.rb
#
# Generate link that you can use to find resources
# Similar to friendly_id gem but much simpler (one file) and you can easily
# update instead of reading DSL for friendly_id
# You just need to define where to store link and which fields to use
# to generate link
#
# For example:
# rails g migration add_link_to_users link:string

Nginx and Puma for Ruby on Rails

When a lot of people are working on the same Rails application, than Vagrant could help to set up environment quick and easy. Even Vagrant is not recommended for production, it is very usefull for testing deployment script. For production we can simply copy deployment script and run manually.

We can deploy Ruby on Rails app using a quick way to deploy ruby on rails on vagrant.

@duleorlovic
duleorlovic / a quick way to deploy ruby on rails on vagrant.md
Last active June 23, 2020 20:20
Quickly deploy any Ruby on Rails application to VirtualBox using Vagrant or to any other provider of Linux machine just running this shell script

Deploy Ruby on Rails

You can use those bootstrap script to deploy your Rails application to Virtualbox. It's not intended to replace Chef or Puppet, but since its plain bash, its very readable and you can copy some lines and paste to your ssh session...

How to use

After installing Vagrant software run vagrant init and edit your Vagrantfile