Skip to content

Instantly share code, notes, and snippets.

View pedrolopesme's full-sized avatar
💡
Coding.

Pedro Mendes pedrolopesme

💡
Coding.
View GitHub Profile
<?php
class OlaMundo{
var $nomeDoUsuario;
/**
* Escreve Ola Mundo
*
* @author Chuck Norris.
*/
<?php
class OlaMundo{
static $nomeDoUsuario;
/**
* Escreve Ola Mundo
*
* @author Chuck Norris.
*/
<?php
class OlaMundo{
static $nomeDoUsuario;
/**
* Cria instancias automaticamente
*
* @author Chuck Norris.
*/
// Criando o handle de uma conexão com o PostgreSQL
$db = new PDO("pgsql:dbname=MEU_DB;host=localhost", "USUARIO", "SENHA" );
// Criando o handle de uma conexão com o MySQL
$db = new PDO("mysql:dbname=MEU_DB;host=localhost", "USUARIO", "SENHA" );
def menino
@pedrolopesme
pedrolopesme / gist:1150657
Created August 17, 2011 02:11
OpenGraph
<meta property="og:title" content="Geopromo"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="http://www.geopromo.com.br"/>
<meta property="og:image" content="http://www.geopromo.com.br/images/icons/opengraph.jpg?1312037161"/>
<meta property="og:site_name" content="Geopromo"/>
<meta property="og:description"
content="Encontre e organize as melhores ofertas da internet baseado na sua localizacao"/>
@pedrolopesme
pedrolopesme / gist:1165072
Created August 23, 2011 13:17
Magento - HTTPS problem
if( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) ) {
$_SERVER['HTTPS'] = 'on';
$_SERVER['SERVER_PORT'] = 443;
}
# Vc monta assim
dict_medias = {}
for pergunta in perguntas:
# Atualiza media
if pergunta.id in dict_medias:
dict_medias[pergunta.id]['media'] = dict_medias[pergunta.id]['media'] + 3
# Cria pergunta
else:
Feature: Search For PageObject Article
As a Blog do Pedro visitor
I want to find for PageObjects article
Scenario:
Given I am on Blog do Pedro's Home Page
When I input a term into search text field
Then I should submit search form
# encoding: UTF-8
Given(/^I am on Blog do Pedro's Home Page$/) do
visit_page HomePage
end
When(/^I input a term into search text field$/) do
on_page HomePage do |page|
page.input_search = "Tradução do artigo sobre PageObjects"
end