mkdir frames | |
ffmpeg -i screencast.mp4 -r 5 'frames/frame-%03d.jpg' | |
cd frames | |
convert -delay 20 -loop 0 -layers Optimize *.jpg myimage.gif |
start = Step.create(name: 'Saudações, aventureiro!', | |
description: 'Cuidado por onde anda. Esta terra | |
está repleta de abismos e feras perigosas.') | |
precipice = Step.create(name: 'Você caiu num precipício :(', | |
description: 'Mais sorte na próxima vez...') | |
dragon = Step.create(name: 'Um dragão te tostou :(', | |
description: 'Nem todo dia é dia de caçador.') |
source 'https://rubygems.org' | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
ruby '2.3.1' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '~> 5.2.1' | |
# Use sqlite3 as the database for Active Record | |
gem 'sqlite3' | |
# Use Puma as the app server |
Boot your system into a live CD. Mount your system into the live CD: | |
sudo mount /dev/sda1 /mnt | |
sudo mount --bind /dev /mnt/dev | |
sudo mount --bind /dev/pts /mnt/dev/pts | |
sudo mount --bind /proc /mnt/proc | |
sudo mount --bind /sys /mnt/sys | |
Log into the mounted system: | |
sudo chroot /mnt |
require 'socket' | |
webserver = TCPServer.new('127.0.0.1', 7777) | |
puts "Iniciando servidor." | |
while (session = webserver.accept) | |
session.print "HTTP/1.1 200/OK\r\nContent-type:text/html\r\n\r\n" | |
begin |
*.swp |
Se você não tem Linux no computador, escolha uma distro (recomendo Debian -- que é a que eu uso -- mas a mais populares atualmente são a Linux Mint, o Ubuntu e o Fedora), baixe (ou baixe, baixe ou baixe) e instale (ou instale, instale ou instale).
Apesar de existirem tantos tutoriais e guias a respeito, o processo de instalação (pelo menos do Ubuntu e do Debian) é bastante simples e qualquer um que alguma vez já tenha instalado alguma coisa a p
Rails 3.1 gives us a really easy way to authenticate users in our app: http_basic_authenticate_with
. Using it, all we need to do is create a model for the user (certainly, User model :P) with an attribute called password_digest and some views feature for login and register users. After all, let's relax and let Rails do the hard work.
gem 'bcrypt-ruby', '~> 3.0.0'
First at all, an User model which we can generate by following:
rails g model user email:string password_digest:string
and then add the following methodo call to generated class:
has_secure_password