Skip to content

Instantly share code, notes, and snippets.

View fdaciuk's full-sized avatar
🔥

Fernando Daciuk fdaciuk

🔥
View GitHub Profile
@fdaciuk
fdaciuk / Mudar_permissoes_de_arquivos_e_diretorios_no_WP.md
Created February 26, 2014 11:53
Mudar permissões de arquivos e diretórios no WP

Mudar permissões de arquivos e diretórios no WP

Mudar permissões de diretórios:

find /path/to/your/wordpress/install/ -type d -exec chmod 755 {} \;

Mudar permissões de arquivos:

Mostrar somente os últimos arquivos alterados no log do git

Esse exemplo mostra todos os arquivos alterados nos últimos dois dias, sem repetir:

git log --pretty=format: --name-only --since="2 days ago" | sort | uniq
@fdaciuk
fdaciuk / Static_Server_Ubuntu_with_Python.md
Last active August 29, 2015 13:58
Simple static server on Ubuntu with Python

Simple static server on Ubuntu with Python

Execute a static server on the current directory.

python -m SimpleHTTPServer [port]

#Elementary OS

Post Install Routine

###First Update sudo apt-get update && sudo apt-get dist-upgrade

###Kernel Updates sudo apt-get install linux-generic-lts-raring

###Essential

@fdaciuk
fdaciuk / WordPress_+_GulpJS_-_Files_structure.md
Created October 21, 2014 01:25
WordPress + GulpJS - Files structure

WordPress + GulpJS - Files structure

src directory, on project root:

├── gulpconfig.js
├── gulpfile.js
├── package.json
├── /images
├── /js
@fdaciuk
fdaciuk / toAscii.php
Created June 29, 2012 13:01 — forked from chluehr/toAscii.php
PHP clean url slug generator / converter (slug)
<?php
// source: http://cubiq.org/the-perfect-php-clean-url-generator
// author: Matteo Spinelli
// MIT License / http://creativecommons.org/licenses/by-sa/3.0/ (please re-check at source)
setlocale(LC_ALL, 'en_US.UTF8');
function toAscii($str, $replace=array(), $delimiter='-') {
if( !empty($replace) ) {
$str = str_replace((array)$replace, ' ', $str);
}
@fdaciuk
fdaciuk / autoset_featured_image.php
Created November 20, 2012 00:40
[WORDPRESS] Setar a primeira imagem do post como post_thumbnail se não houver nenhuma setada. (Créditos a Bruno Cantuaria)
@fdaciuk
fdaciuk / deploy_git.sh
Created December 16, 2012 00:24
Teste para deploy de GIT
git checkout master
git branch
echo '### PRODUÇÃO REPORT ###'
git status
echo '++++++++++++++++++++++'
echo 'Deseja fazer o deploy [s/n]?'
read deploy
echo '++++++++++++++++++++++'
@fdaciuk
fdaciuk / ex_filter.php
Created December 16, 2012 16:26
Exemplo de conteúdo após o the_content
<?php
function depois_the_content( $content ) {
global $post;
$content .= 'Isso vai aparecer depois do conteúdo';
return $content;
}
add_filter( 'the_content', 'depois_the_content' );
@fdaciuk
fdaciuk / cpt.php
Last active December 11, 2015 18:58
Criar CPT no WP
<?php
/**
* Arquivo para criação de CPTs e Taxonomias
*
*/
// CPT Labs
$create_cpt->cpt( array(
'slug' => 'labs',
'name' => 'Labs',