Skip to content

Instantly share code, notes, and snippets.

View fdaciuk's full-sized avatar
🔥

Fernando Daciuk fdaciuk

🔥
View GitHub Profile

Remover meta tag generator do WooCommerce

@fdaciuk
fdaciuk / Placeholder_automatico_para_varios_campos.md
Last active December 31, 2015 02:29
Placeholder automático para vários campos usando jQuery

Placeholder automático para vários campos usando jQuery

Para adicionar novos inputs, inclua no objeto _input_info o ID e o texto do placeholder

Exemplo funcional: http://codepen.io/anon/pen/DCnKI

@fdaciuk
fdaciuk / my_wp_is_mobile.php
Created December 5, 2013 11:14
wp_is_mobile personalizada para não usar no iPad
<?php
function my_wp_is_mobile() {
if (
! empty($_SERVER['HTTP_USER_AGENT'])
// bail out, if iPad
&& false !== strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')
) return false;
return wp_is_mobile();
} // function my_wp_is_mobile
@fdaciuk
fdaciuk / css-vertical-align.css
Created November 21, 2013 18:01
Magia para alinhar imagem na vertical
span {
display: inline-block;
height: 100%;
vertical-align: middle;
}
img {
display: inline-block;
vertical-align: middle;
}
$font-size: 16;
@function strip-unit($num) {
@return $num / ($num * 0 + 1);
}
@mixin rem($property, $values...) {
$max: length($values);
$pxValues: '';
$remValues: '';
@fdaciuk
fdaciuk / mixin-rem-px.sass
Created October 29, 2013 15:52
Mixin para usar qualquer propriedade com REM, com fallback para PX
// Configuração para HTML
html
font-size: 62.5%
@mixin rem( $prop, $val )
#{$prop} : $val + px // pixels
#{$prop} : $val / 10 + rem // rem
$c = (function( $ ) {
var DOMCACHESTORE = {};
return function( selector, force ) {
if ( force || undefined === DOMCACHESTORE[selector] ) {
DOMCACHESTORE[selector] = $(selector);
}
return DOMCACHESTORE[selector];
};
// SmoothScroll for websites v1.2.1
// Licensed under the terms of the MIT license.
// People involved
// - Balazs Galambosi (maintainer)
// - Michael Herf (Pulse Algorithm)
(function(){
// Scroll Variables (tweakable)
@fdaciuk
fdaciuk / .bashrc
Created September 28, 2013 01:54
Arquivo de configuração do terminal .bash_profile no Mac ou .bashrc no Linux
# GREP
export GREP_OPTIONS='--color=auto'
export GREP_COLOR='1;33'
alias grep='grep --color=auto' # Always highlight grep search term
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# LS COLORS
@fdaciuk
fdaciuk / odin_functions_metabox.php
Last active December 23, 2015 15:29
Tags para abertura e fechamento da Metabox e dos Custom Fields na Classe de Metabox do Odin
<?php
// Include the Odin_Metabox class.
require_once get_template_directory() . '/core/classes/class-metabox.php';
function video_metabox_example() {
$videos_metabox = new Odin_Metabox(
'videos', // Slug/ID of the Metabox (Required)
'Videos Configuration', // Metabox name (Required)