Skip to content

Instantly share code, notes, and snippets.

View fillipetech's full-sized avatar

Fillipe Amorim fillipetech

View GitHub Profile
@fillipetech
fillipetech / extend_user_search.php
Last active July 17, 2018 18:08
Search Users by name and other fields #wp #users
/**
Extend user search in wp-admin
include first_name, last_name and other fields in the search results
**/
add_action('pre_user_query','extend_user_search');
function extend_user_search( $user_query ){
// make sure that this code will be applied only for user search
if ( $user_query->query_vars['search'] ){
$search_query = trim( $user_query->query_vars['search'], '*' );
if ( $_REQUEST['s'] == $search_query ){
@fillipetech
fillipetech / reset_video_visible_area.js
Last active July 17, 2018 18:11
Reset Video on Visible Viewport area #js #jquery #video
/**
* Reset video on visible area
*/
jQuery(document).ready(function($) {
$(window).scroll(function() {
$('video').each(function(){
if ($(this).is(":in-viewport")) {
$(this)[0].play();
} else {
$(this)[0].currentTime = 0;
@fillipetech
fillipetech / gist:c6025ecadde0d50dc331609d76f65bc9
Created June 10, 2016 07:41 — forked from joho/gist:3735740
PostgreSQL 9.2 upgrade steps
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. brew update
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. cp /usr/local/Cellar/postgresql/9.2.0/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
@fillipetech
fillipetech / Adicionar novo campo (custom field) a uma taxonomia (categoria, tag, etc) no WordPress.md Adicionar novo campo (custom field) a uma taxonomia no WordPress (Incluir esse código no functions.php)Nas action_hooks, no lugar de "category" é só incluir o slug da sua taxonomia :)

Adicionar novo campo (custom field) a uma taxonomia (categoria, tag, etc) no WordPress

Incluir esse código no functions.php.

Nas action_hooks, no lugar de "category" é só incluir o slug da sua taxonomia :)

@fillipetech
fillipetech / .bash_profile
Created July 4, 2015 08:07
Bash_profile personalizado com atalhos e configurações
# ---------------------------------------------------------------------------
# Descrição: Este arquivo contém todas as minhas configurações e atalhos personalizados para o Bash
#
# Sessões:
# 1. Configurações Básicas
# 2. Definição de atalhos
# 3. Gerenciamento de arquivos e pastas
# 4. Pesquisa
# 5. Rede
# 6. Operações & Informações