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
<div id="paginador">
<?php
include 'conexao/conexao.php';
$criterio = "";
if ($_GET["criterio"]!=""){
$txt_criterio = $_GET["criterio"];
$criterio = " where noticia like '%" . $txt_criterio . "%'";
}
@julioprotzek
julioprotzek / cucumber-1.0.4.gemspec
Created September 11, 2011 17:19
Illformed requirement on cucumber-1.0.4.gemspec
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = "cucumber"
s.version = "1.0.4"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Aslak Helles\u{f8}y"]
s.date = "2011-09-11"
s.description = "Behaviour Driven Development with elegance and joy"
@julioprotzek
julioprotzek / original.js
Created November 15, 2011 20:39
Refactored Javascript
$(function(){
$('.star-rating').each(function(){
$(this).raty({
path: '/images/',
readOnly: cookieTest($(this).attr('id')),
start: 3,
click: function(score, evt) {
@julioprotzek
julioprotzek / rails_bootstrap.rb
Created September 4, 2012 18:16
rails bootstrap
gem "rspec-rails", group: ["test", "development"]
gem "cucumber-rails", group: "test"
gem "factory_girl_rails", group: "test"
gem "devise"
generate("rspec:install")
generate("cucumber:install")
generate("devise:install")
generate("devise", "user")
@julioprotzek
julioprotzek / template.rb
Created October 8, 2012 14:39
Startaê Bootstrap
remove_file 'Gemfile'
create_file 'Gemfile'
add_source "http://rubygems.org"
gem 'rails', '~> 3.2.8'
gem 'jquery-rails'
if yes?('PostgreSQL on development?')
gem 'pg'
@julioprotzek
julioprotzek / excercicio-1.md
Created October 29, 2012 00:32
CRUD de notícias para o Biscoito Globo

Biscoito Globo

O objetivo desse exercício é criar um CRUD de notícias para a administração do gerenciador de conteudo do biscoito globo. Nós vamos esconder essa área de administração na próxima aula com login e senha.

Para criar uma nova app rails:

rails new biscoito-globo -T -m https://raw.github.com/gist/3852875
git checkout -b nomebranch novo # criar branch
git branch # listar branchs
git checkout nomebranch # ir para um branch
# jogar mudanças para o master
git checkout master
git merge nome_do_outro_branch
config.wrappers :bootstrap, :tag => 'div', :class => 'form-group', :error_class => 'has-error' do |b|
b.use :html5
b.use :placeholder
b.use :label
b.use :input, :wrap_with => { :tag => 'div', :class => 'controls' }
b.use :error, :wrap_with => { :tag => 'span', :class => 'help-block' }
b.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
end
config.form_class = "form-vertical"
config.input_class = "form-control"
source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '4.0.0'
# database
gem 'pg', '~> 0.16.0'
# assets
gem 'sass-rails', '~> 4.0.0'
doctype html
html
head
title Paporeto
= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true
= javascript_include_tag "application", "data-turbolinks-track" => true
= csrf_meta_tags
body
= yield