Skip to content

Instantly share code, notes, and snippets.

View tarciozemel's full-sized avatar

Tárcio Zemel tarciozemel

View GitHub Profile
@tarciozemel
tarciozemel / gist:4511190
Created January 11, 2013 14:46
WordPress: busca com Custom Fields
//
// By default, WordPress comes with a handy search but it only search in post
// titles and contents. If you are working on a custom post type, you most
// probably using custom fields to store its attributes. For example, A
// Property custom post type would have address, city and state custom fields.
// You may have used WP_Query object with meta_query setup, But, it does not
// work. If you do not use “s” attribute, it will overwrite the default search
// and If you use it, it will not return the expected results. This snippet will
// use posts_clauses filter to inject the meta query that will combine with the
// WordPress’s default search parameter.
@tarciozemel
tarciozemel / gist:4420514
Created December 31, 2012 15:09
JavaScript: Media Queries sob demanda
/**
* Carregamento condicional de css/img conforme a resolução.
*
* Através de data-*, permite que somente as folhas de estilos (e,
* opcionalmente, imagens) que batem com determinada resolução sejam
* carregados e entrem em ação.
*
* Deve-se usar seguindo o modelo:
* <link rel="stylesheet"
* class="mediaquerydependent"
@tarciozemel
tarciozemel / .gitignore
Last active May 25, 2022 13:03
Git: .gitignore
### User template
# Folders
bower_components/
.project
.nuxt
# Compiled source
*.class
*.com
*.dll
@tarciozemel
tarciozemel / gist:1884583
Last active June 22, 2016 16:52 — forked from adrienjoly/include.js
JavaScript: incluir arquivos js/css dinamicamente
/*
* Ex:
* include("http://mysite.com/bookmarklet.css");
* include("http://mysite.com/bookmarklet.js");
*/
let include = ( src, callback ) => {
let ext = src.split( /[\#\?]/ )[ 0 ].split( '.' ).pop().toLowerCase();
let inc;
if ( ext === 'css' ) {