Skip to content

Instantly share code, notes, and snippets.

View julioprotzek's full-sized avatar
🎯
Focusing

Julio Protzek julioprotzek

🎯
Focusing
View GitHub Profile
$itens= array();
while($row_tabela = mysql_fetch_row($result_query))
{
$itens[]= $row_tabela[2];
}
echo implode(',', $itens);
<!doctype html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<title>Flash</title>
<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<style> article, aside, figure, footer, header, hgroup, menu, nav, section { display: block; } </style>
<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script>
swfobject.embedSWF("<?php echo $url ?>/arquivo.swf", "flash_banner", "300", "120", "9");
<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"