Skip to content

Instantly share code, notes, and snippets.

View chrdesigner's full-sized avatar

César Ribeiro chrdesigner

View GitHub Profile
@chrdesigner
chrdesigner / 00-README.md
Created February 16, 2017 17:04
Git List - Exibir ou Ocultar a sua senha com jQuery
@chrdesigner
chrdesigner / 00-README.md
Last active November 4, 2016 22:52
Git List - Executar um vídeo a partir de um click na thumbnail
@chrdesigner
chrdesigner / update_row_colours.js
Created September 25, 2016 17:03
Aplica verificação de cor na tabela se a data é maior ou não, dentro do field repeater ACF
jQuery(document).ready(function($) {
var update_row_colours = function() {
$('[data-name="adicionar_experiencias"] .acf-table .acf-row').each( function() {
var strat = $( this ).find('[data-name="iniciou_no_dia"] input.input-alt');
var end = $( this ).find('[data-name="terminou_no_dia"] input.input-alt');
var strat_date = new Date( strat.val() );
@chrdesigner
chrdesigner / README.md
Last active April 15, 2016 20:04
Borda Serrilhada Somente com CSS 3

Formulário de Departamentos com Suporte de Option Group

Contact Form 7 + Option Group

Criação de um formulário via Contact Form 7 com select personalizado com Option Group para seleção de departamentos.

Download do Contact Form 7

@chrdesigner
chrdesigner / functions.php
Last active February 17, 2016 18:01
List All Categories and Subcategories and return the last post register
<?php
/**
* Returns ID of top-level parent category, or current category if you are viewing a top-level
*
* @param string $catid Category ID to be checked
* @return string $catParent ID of top-level parent category
*/
function smart_category_top_parent_id ($catid) {
while ($catid) {
$cat = get_category($catid); // get the object for the catid
@chrdesigner
chrdesigner / functions.php
Last active December 12, 2015 18:20
Transform HEX to RGB with PHP
<?php
function hex2RGB($hex) {
$hex = str_replace("#", "", $hex);
if(strlen($hex) == 3) {
$r = hexdec(substr($hex,0,1).substr($hex,0,1));
$g = hexdec(substr($hex,1,1).substr($hex,1,1));
$b = hexdec(substr($hex,2,1).substr($hex,2,1));
} else {
$r = hexdec(substr($hex,0,2));
$g = hexdec(substr($hex,2,2));
@chrdesigner
chrdesigner / main.js
Last active September 14, 2017 21:12
Máscara em jQuery para o oite e nove dígitos
// <![CDATA[
jQuery(function($) {
$.mask.definitions['~']='[+-]';
//Inicio Mascara Telefone
$('input[type=tel]').focusout(function(){
var phone, element;
element = $(this);
element.unmask();
phone = element.val().replace(/\D/g, '');
if(phone.length > 10) {
@chrdesigner
chrdesigner / main.js
Created December 10, 2015 01:11
Script for reload only different Browser Width
//Create the VAR for get browser size
var windowWidth = $(window).width();
$(window).bind('resize', function(e) {
//Verification with my VAR windowWidth is different Window size
if(windowWidth != $(window).width()){
//Create a delay for reload
if (window.RT) clearTimeout(window.RT); window.RT = setTimeout(function() {
this.location.reload(false);
}, 200);
@chrdesigner
chrdesigner / main.js
Created October 11, 2015 16:43
jQuery: addClass in <html> if size bellow 415
var $window = $(window), $html = $('html');
$window.resize(function resize(){
if ($window.width() < 415) {
return $html.addClass('mobile');
}
$html.removeClass('mobile');
}).trigger('resize');