Skip to content

Instantly share code, notes, and snippets.

View omariosouto's full-sized avatar

Mario Souto omariosouto

View GitHub Profile
@omariosouto
omariosouto / compilador-sass.md
Created October 23, 2015 12:57 — forked from renanlara/compilador-sass.md
Compilador SASS

Linux / Ubuntu 14.04 LTS

  • 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

@omariosouto
omariosouto / clickoutelement.js
Last active October 27, 2015 16:48
EN - Click out element remove class | PT - Clique fora de um elemento e remova uma class
//You can use it for make an event like: "Click out of element and remove a class (for example)."
// Você pode usar isso para fazer um evento como: "Clique fora do elemento e remova uma class (por exempo)."
$(document).mouseup(function (e)
{
var container = $("YOUR ELEMENT");
if (!container.is(e.target) // if the target of the click isn't the container...
&& container.has(e.target).length === 0) // ... nor a descendant of the container
{
@omariosouto
omariosouto / wp_bootstrap_navwalker.php
Last active October 28, 2015 13:16
Menu Wordpress with Bootstrap
<?php
/**
* Class Name: wp_bootstrap_navwalker
* GitHub URI: https://github.com/twittem/wp-bootstrap-navwalker
* Description: A custom WordPress nav walker class to implement the Bootstrap 3 navigation style in a custom theme using the WordPress built in menu manager.
* Version: 2.0.4
* Author: Edward McIntyre - @twittem
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@omariosouto
omariosouto / jquery.mask.script.js
Last active October 28, 2015 19:26
JqueryMask Script
//Mascara dos campos de telefone com Jquery Mask
//Mask for phone fields with Jquery Mask
jQuery(function($){
$(".campoTelefone").mask("(99) 9999-9999", { placeholder: ' ' } );
$(".campoCelular").mask( "(99) 9999-9999?9", { placeholder: ' ' } );
});
@omariosouto
omariosouto / wp_get_pages.php
Last active October 30, 2015 19:57
Get Wordpress Child Pages
<?php
$args = array(
'post_type' => 'page',
'post_parent' => 96,
'post_status' => 'publish',
'orderby' => 'title',
'order' => 'ASC'
);
@omariosouto
omariosouto / placeholdercolor.css
Created November 3, 2015 18:45
Change Placeholder Color with CSS3
::-webkit-input-placeholder {
color: red;
}
:-moz-placeholder { /* Firefox 18- */
color: red;
}
::-moz-placeholder { /* Firefox 19+ */
color: red;
@omariosouto
omariosouto / queries.sql
Last active November 4, 2015 15:23 — forked from renanlara/myphpadmin.sql
Atualizar as URLs no Banco de Dados do WordPress
UPDATE wp_options SET option_value = replace(option_value, 'http://url-antiga.com.br', 'http://url-nova.com.br') WHERE option_name = 'home' OR option_name = 'siteurl';
SET SQL_SAFE_UPDATES=0;
UPDATE wp_posts SET guid = replace(guid, 'http://url-antiga.com.br','http://url-nova.com.br');
SET SQL_SAFE_UPDATES=0;
UPDATE wp_posts SET post_content = replace(post_content, 'http://url-antiga.com.br', 'http://url-nova.com.br');
(function (window, document, undefined) {
'use strict';
// Initialize the media query
var mediaQuery = window.matchMedia('(min-width: 560px)');
// Add a listen event
mediaQuery.addListener(doSomething);
// Function to do something with the media query
@omariosouto
omariosouto / wp-logged-in.php
Created November 25, 2015 12:35
Exibir conteúdo apenas quando estiver logado no WordPress
<?php if ( is_user_logged_in() ) : ?>
// Aqui vai o conteúdo
<?php endif; ?>
// https://codex.wordpress.org/Function_Reference/is_user_logged_in
@omariosouto
omariosouto / index.php
Created December 15, 2015 13:19
Image Pré Video
<!-- Video Model: Desktop -->
<div class="video-full">
<div class="video-fechado" data-rel="V5vY6XXmo_8">
<div class="video">
<span class="imgPreVideo">
<img width="750" height="464" src="http://img.youtube.com/vi/V5vY6XXmo_8/maxresdefault.jpg" class="img-responsive colorbox-55 wp-post-image" alt="Cursos"> <i class="play uf-videos-portal"></i>
<span class="clearfix"></span>
</span>
<div class="embed-responsive embed-responsive-16by9"></div>
</div>