This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#In the gvim.desktop desktop file (/usr/share/applications/ for most GNU/Linux systems) look for the "Exec" line. It will probably be like this: | |
#Look for this line | |
Exec=gvim -f %F | |
#Change the Exec line to: | |
Exec=gvim -p --remote-tab-silent %F | |
#IMPORTANT | |
#You may also need to change the StartupNotify value to "false" if it is currently set "true", or your Vim may not respond properly when the file is already open in a tab. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#search only inside php files. For ALL files, remove the --include option | |
grep -nHoR --include=*.php 'searched_string' * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#source http://blog.escapecreative.com/wordpress-display-all-images-attached-to-post-page/ | |
$images =& get_children( array ( | |
'post_parent' => $post->ID, | |
'post_type' => 'attachment', | |
'post_mime_type' => 'image' | |
)); | |
if ( empty($images) ) { | |
// no attachments here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#source http://bavotasan.com/2011/a-better-way-to-remove-images-from-a-wordpress-post/ | |
function remove_images( $content ) { | |
$postOutput = preg_replace('/<img[^>]+./','', $content); | |
return $postOutput; | |
} | |
add_filter( 'the_content', 'remove_images', 100 ); | |
?> | |
<?php remove_filter( 'the_content', 'remove_images', 100 ); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#GIT# | |
git checkout -b branch-name master | |
git status | |
git add <some-file> | |
git commit | |
git push -u origin branch-name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Display Image from the_post_thumbnail or the first image of a post else display a default Image | |
* Chose the size from "thumbnail", "medium", "large", "full" or your own defined size using filters. | |
* USAGE: <?php echo my_image_display(); ?> | |
*/ | |
function my_image_display($size = 'full') { | |
if (has_post_thumbnail()) { | |
$image_id = get_post_thumbnail_id(); | |
$image_url = wp_get_attachment_image_src($image_id, $size); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stop tracking file | |
git update-index --assume-unchanged <filename> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* @param $publicado | |
* @return array | |
*/ | |
public function getBackgroundHomeFunc($publicado = 1) | |
{ | |
$dql = "SELECT e FROM {$this->entity} e WHERE 1 = 1"; | |
$parametros = array(); |