Skip to content

Instantly share code, notes, and snippets.

View sergiopvilar's full-sized avatar

Sergio Vilar sergiopvilar

View GitHub Profile
@sergiopvilar
sergiopvilar / index.php
Created August 7, 2012 20:39
Autorizaçã de contas do Facebook usando a PHP SDK
<?php
include("sdk/facebook.php");
define('APP_ID', 'id_do_aplicativo');
define('APP_SECRET', 'app_secret_do_aplicativo');
define('REDIRECT_URI', 'https://url.de/retorno');
define('PERMS', 'publish_stream,status_update,offline_access,create_event,email,user_likes,rsvp_event');
$facebook = new Facebook(array(
@sergiopvilar
sergiopvilar / styles.css
Created August 8, 2012 13:10
WordPress WYSIWYG Editor Styles
/* == WordPress WYSIWYG Editor Styles == */
.entry-content img {
margin: 0 0 1.5em 0;
}
.alignleft, img.alignleft {
margin-right: 1.5em;
display: inline;
float: left;
}
<?php
// Faz a query no Wordpress
query_posts('category_name=lancamentos');
// Faz o laço de posts
while(have_posts()): the_post();
// Conteúdo do post aqui
// the_content(), the_title(), etc
<?php
// Cria o formulário
$formulario = new FormularioContato(get_page_option('emailcontato'), "Cão Cidadão - Site", "noreply@caocidadao.com.br", "Envio a partir do site");
$formulario->showForm(get_permalink()."?post=true","contato","form_contato","form_contato");
// Define os campos
$formulario->text("nome","Nome",true, "text", "nome", "Nome");
$formulario->text("email","Email",true,"text", "email", "Email");
$formulario->text("telefone","Telefone",false,"text","telefone", "Telefone");
<!DOCTYPE html>
 
<html>
        <head>
                <title>Learning the basics of canvas</title>
                <meta charset="utf-8">
 
                <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  <style type="text/javascript">
#myCanvas{
<?php
$datainicio = date('Y-m-d');
$diasuteis = 120;
$restante = $diasuteis+1;
for($i = 0; $restante>0; $i++):
$thisdata = strtotime('+'.$i.' day', strtotime($datainicio));
$thisdiasemana = date('N', $thisdata);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!-- Código do widget que o Zopim fornece -->
<script type="text/javascript">
window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s=
d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
_.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute('charset','utf-8');
require([
// Carregados em todas as páginas
'js/libs/jquery.js',
'js/libs/less.js',
'js/libs/modernizr.js',
'js/modules/common.js',
]);
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
RewriteCond %{REQUEST_URI} ^/img/
RewriteRule ^img/(.*)$ http://static1.feiraocarrofacil.com.br/$1 [R=301,L]
</IfModule>
var Namespace = {};
require([
"jquery",
"libs/mousewheel",
"libs/jquery.jscrollpane.min",
"modules/common",
"modules/home",