Skip to content

Instantly share code, notes, and snippets.

View renanlara's full-sized avatar

Renan Lara renanlara

View GitHub Profile
@renanlara
renanlara / index.php
Last active August 29, 2015 14:04
Puxar dados de uma div de site via php
<?php
// Habilita todas mensagens de erros que possa acontecer
ini_set('display_errors', 1);
error_reporting(E_ALL);
// Declaração de variáveis
$encontrouDiv = false;
// Pega o conteúdo do site (retornado como string) e coloca dentro de uma variável
$urlContent = file_get_contents('http://www.url.com.br/');
@renanlara
renanlara / compilador-sass.md
Last active November 25, 2015 12:39
Compilador SASS

Linux / Ubuntu

  • Instale o Ruby > $ sudo apt-get install ruby-full
  • Instale o SASS > $ sudo su -c "gem install sass"
  • Instale o Compass -> $ sudo gem install compass

Windows

@renanlara
renanlara / config.rb
Created October 21, 2015 12:10
Example config.rb
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"
# You can select your preferred output style here (can be overridden via the command line):
@renanlara
renanlara / cycle2.html
Created October 29, 2015 18:11
Exemplo de marcação HTML do Cycle2
<div class="cycle-slideshow" data-cycle-fx="scrollVert" data-cycle-slides=".slides" data-cycle-swipe="true" data-cycle-timeout="8000" data-cycle-pager=".navSlides">
<div class="slides">
<!-- Adicione div. images, textos e etc. -->
</div>
<!-- Navegação -->
<div class="navSlides"></div>
</div>
<a href="http://jquery.malsup.com/cycle2/" target="_blank">Cycle2</a>
@renanlara
renanlara / Deploy com Git
Created October 30, 2015 19:00 — forked from alanyoshida/Deploy com Git
Fazendo Deploy de um projeto direto para o servidor via ssh usando o git.
# Primeiro crie um repositorio Local.
$ git init
Initialized empty Git repository in C:\Projetos\site\.git
$ cat ' ' > index.html
$ git add index.html
$ git commit -q -m "Iniciando o repositório"
# No Servidor
# Crie Repositorio Vazio
$ mkdir site.git && cd site.git
@renanlara
renanlara / functions.php
Last active November 19, 2015 18:25
Agendamento de Popup no Plugin Popup Maker
<?php
// Popup Maker - https://wordpress.org/plugins/popup-maker/
function mycustom_popup_is_loadable( $is_loadable, $popup_id) {
if( $popup_id == 80 ) { // ID do Post
$start = strtotime( '2015-11-23 14:00:00' ); // Data de Início
$end = strtotime( '2015-11-26 23:59:00' ); // Data do Término
$now = strtotime( 'now' );
if( $now >= $start && $now <= $end ) {
@renanlara
renanlara / contact-form7.css
Last active February 29, 2016 17:25
Contact Form 7 - Customizar mensagens de erros
body input[type=text].wpcf7-not-valid,
body input[type=email].wpcf7-not-valid,
body input[type=tel].wpcf7-not-valid,
body textarea.wpcf7-not-valid {
border: 1px solid #ec3c06;
}
body span.wpcf7-not-valid-tip {
background: none;
border: none;
@renanlara
renanlara / contact-form7.scss
Last active December 22, 2022 10:43
Checkbox and Radio Button Custom - Contact Form 7
.wpcf7-checkbox, .radio {
display: block;
margin: 10px 0 0;
.wpcf7-list-item {
display: block;
input[type=checkbox], input[type=radio] {
display: none;
@renanlara
renanlara / navbar.scss
Created January 21, 2016 16:45
Show in hover navbar dropdown-menu bootstrap
.dropdown {
&:hover {
.dropdown-menu{
display: initial;
visibility: visible;
opacity: 1;
@include transition(0.1s ease-in-out);
}
}
}
@renanlara
renanlara / page.php
Last active February 19, 2016 14:32
Especifique qual arquivo usar para páginas filhas.
<?php
/**
* Espeficicar por padrão.
*/
if( $post->post_parent !== 0 ) {
get_template_part('page', 'child');
} else {
get_template_part('page', 'default');
}
?>