Skip to content

Instantly share code, notes, and snippets.

View julioprotzek's full-sized avatar
Vacation Mon Apr 22 - Fri Apr 26

Julio Protzek julioprotzek

Vacation Mon Apr 22 - Fri Apr 26
View GitHub Profile
import javax.swing.*;
public class RecomendacaoDeFilmes {
public static void main(String[] entrada) {
char opcao;
String msg = "";
String[] todosOsGeneros = {
"Ação",
"Terror",
"Ficção Científica"
doctype html
html
head
meta name="viewport" content="width=device-width, initial-scale=1.0"
title Paporeto
= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true
= csrf_meta_tags
/[if lt IE 9]
= javascript_include_tag "html5shiv", "data-turbolinks-track" => true
doctype html
html
head
meta name="viewport" content="width=device-width, initial-scale=1.0"
title Paporeto
= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true
= csrf_meta_tags
/[if lt IE 9]
= javascript_include_tag "html5shiv", "data-turbolinks-track" => true
doctype html
html
head
meta name="viewport" content="width=device-width, initial-scale=1.0"
title Paporeto
= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true
= csrf_meta_tags
/[if lt IE 9]
= javascript_include_tag "html5shiv", "data-turbolinks-track" => true
@julioprotzek
julioprotzek / drop_articles.rb
Last active January 1, 2016 18:09
Explicação no comentário.
class DropArticles < ActiveRecord::Migration
def up
drop_table :articles
end
def down
create_table :articles do |t|
t.string :title
t.text :body
t.datetime :published_at
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
cd Desktop
rails new paporeto
cd paporeto
rails s
rails g scaffold article title:string body:text published_at:datetime
class Article < ActiveRecord::Base
validates :title, :category, presence: true
belongs_to :category
end
class Article < ActiveRecord::Base
validates :title, presence: true
end
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'