Skip to content

Instantly share code, notes, and snippets.

View claudiosanches's full-sized avatar
👨‍💻

Claudio Sanches claudiosanches

👨‍💻
View GitHub Profile
@mfields
mfields / gist:965956
Created May 11, 2011 05:19
Wrap WordPress Enbeds in a div
<?php
/**
* Enclose embedded media in a div.
*
* Wrapping all flash embeds in a div allows for easier
* styling with CSS media queries.
*
* @todo Document parameters.
*
* @access private
@claudiosanches
claudiosanches / update_database.sql
Created October 11, 2012 04:47
WordPress: Update Database to Deploy
# Update post_content
UPDATE wp_posts SET post_content = REPLACE(post_content,'http://localhost/cliente/wp-content/uploads/','http://www.cliente.com/wp-content/uploads/');
# Update guid
UPDATE wp_posts SET guid = REPLACE(guid,'http://localhost/cliente/wp-content/uploads/','http://www.cliente.com/wp-content/uploads/');
@claudiosanches
claudiosanches / .gitignore
Created November 24, 2012 02:46
GIT: Include empty directories
# Ignore everything in this directory
*
# Except this file
!.gitignore
@markoheijnen
markoheijnen / gist:4236025
Last active October 13, 2015 18:17
WordPress Engine shortcode
<?php
class Marko_Shortcodes {
public function __construct() {
add_shortcode( 'engine_info', array( $this, 'engine_info' ) );
}
public function engine_info( $atts ) {
global $wp_version, $wpdb, $batcache, $wp_object_cache;
@claudiosanches
claudiosanches / bomfinder.php
Last active November 24, 2015 18:20
UTF8 BOM finder
<?php
// Tell me the root folder path.
// You can also try this one
// $home = $_SERVER['DOCUMENT_ROOT'];
// Or this
// dirname( __FILE__ )
$home = dirname( __FILE__ );
// Is this a Windows host ? If it is, change this line to $windows = true;
$windows = false;
@fdaciuk
fdaciuk / .jshintrc
Last active December 15, 2015 13:19
Gruntfile.js padrão para projetos em WP.
{
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"sub": true,
"undef": true,
"boss": true,
@bmihelac
bmihelac / processors.py
Last active December 15, 2015 19:18
easy-thumbnails watermark to right bottom corner of the image
# custom/processors.py
from django.conf import settings
from django.core.files.storage import default_storage
try:
from PIL import Image
except ImportError:
import Image
@claudiosanches
claudiosanches / fix-boleto.php
Last active December 16, 2015 10:59
Fix WooCommerce Boleto ID with WooCommerce Sequential Order Numbers
<?php
/**
* Plugin Name: Fix WooCommerce Boleto ID with WooCommerce Sequential Order Numbers
* Plugin URI: http://claudiosmweb.com/
* Description: WooCommerce Boleto is a brazilian payment gateway for WooCommerce
* Author: claudiosanches
* Author URI: http://claudiosmweb.com/
* Version: 0.1
* License: GPLv2 or later
*/
@claudiosanches
claudiosanches / .htaccess
Last active December 16, 2015 20:59
Custom php.ini
suPHP_ConfigPath /home/user/public_html
<Files php.ini>
order allow,deny
deny from all
</Files>
@claudiosanches
claudiosanches / nginx.conf
Created July 1, 2013 19:30
Django-CMS - Correção da URL do pt-br
rewrite ^/?pt\-BR/(.*)$ /pt-br/$1 permanent;
rewrite ^/?pt\_BR/(.*)$ /pt-br/$1 permanent;