Skip to content

Instantly share code, notes, and snippets.

View luisabarca's full-sized avatar
🏠
Working from home

Luis Abarca luisabarca

🏠
Working from home
View GitHub Profile
@luisabarca
luisabarca / gist:6613175
Created September 18, 2013 18:16
Código para el plugin Like Box de Facebook para Emergencias Guerrero
<iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2FGuerreroPortal&amp;width=292&amp;height=395&amp;colorscheme=light&amp;show_faces=false&amp;header=false&amp;stream=true&amp;show_border=true&amp;appId=189372933268" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px; height:395px;" allowTransparency="true"></iframe>
@luisabarca
luisabarca / gist:6613151
Created September 18, 2013 18:13
Código para el Hastag de Twitter #EmergenciasGuerrero
<a class="twitter-timeline" href="https://twitter.com/search?q=%23EmergenciasGuerrero" data-widget-id="380380757929119744">Tweets about "#EmergenciasGuerrero"</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
@luisabarca
luisabarca / gist:4748854
Last active December 12, 2015 09:08
Permissions for Gitolite user folder and SSH keys on QNAP
# git is my username
chmod g-w /share/HDA_DATA/git
chmod 700 /share/HDA_DATA/git/.ssh
chmod 600 /share/HDA_DATA/git/.ssh/authorized_keys
@luisabarca
luisabarca / gist:2880017
Created June 6, 2012 04:58
OSX: Disable .DS_Store creation on network drives
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
@luisabarca
luisabarca / gist:2394739
Created April 15, 2012 20:44
WordPress: Search with multiple taxonomies
<?php
add_action('pre_get_posts', '_custom_search');
function _custom_search()
{
global $wp_query;
if ( $wp_query->query_vars['post_type'] != REALTY_POST_TYPE ||
!$wp_query->is_post_type_archive ) {
return false;
@luisabarca
luisabarca / category-color-field.php
Created December 28, 2011 00:16
Wordpress: Custom fields in Category
<table class="form-table">
<tr class="form-field">
<th><label for="category_color">Category color</label></th>
<td>
<input id="category_color" type="text" name="category_color" value="<?php echo $current_color ?>" />
<span class="description">
Category Color.</span>
</td>
</tr>
@luisabarca
luisabarca / form.php
Created December 17, 2011 18:32
Bienes raices Test Plugin
<p>
<label for="m2">Metros cuadrados</label>
<input type="text" id="m2" name="m2" value="<?php echo $m2 ?>" />
</p>
<p>
<label for="construido">Superficie construida</label>
<input type="text" id="construido" name="construido" value="<?php echo $construido ?>" />
</p>
@luisabarca
luisabarca / gist:a36126c469156e9c182d
Created November 22, 2011 15:44
Show custom post types in a category
<?php
add_filter('pre_get_posts', 'init_category');
function init_category($wp_query)
{
$vars = $wp_query->query_vars;
if (is_category() && !array_key_exists('portfolio', $vars)) {
$vars = array_merge( $vars, array('post_type' => 'any') );
@luisabarca
luisabarca / functions.php
Created June 2, 2011 01:41 — forked from ScottPhillips/createqrcode.php
Create post QR Code using Google Charts
/**
* Return a QR Code
*/
function get_the_QRcode($postID = 0, $size ='150', $evLevel='L', $margin='0')
{
global $post;
if ( is_null($postID) ) {
$postID = $post->ID;
}
@luisabarca
luisabarca / gist:963975
Created May 10, 2011 05:58
Cambiar permisos a varios archivos o carpetas / Chmod to any file or folder
# Para Archivos
find . -type f -print0 | xargs -0 chmod 644
# Para carpetas
find . -type d -print0 | xargs -0 chmod 755