Skip to content

Instantly share code, notes, and snippets.

View gnuget's full-sized avatar

David Valdez gnuget

View GitHub Profile
@gnuget
gnuget / gist:1190159
Created September 2, 2011 22:59
My Bash Profile
#prompt decente
export PS1="[\u@\h \w]$ "
#UTF-8!
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
#paginas man
export MANPATH=/opt/local/share/man:$MANPATH
@gnuget
gnuget / vimrc
Created February 4, 2011 06:14
Mi vimrc
"Basicas, color de tema, encoding,tabs etc
set t_Co=256
colorscheme xoria256
set gfn=Monospace
set encoding=utf-8
set nocompatible
filetype on
filetype plugin on
set hlsearch
set ignorecase
<div class="step01">
<a class="StepsPopUp" href="javascript:return(void);">
<h3>Regístrate</h3>
<span>
<div class="close"><img src="images/slideshow/howitworks/close-x.png" /></div>
<h4>Regístrate</h4>
<p>-Regístrate para obtener tu dirección en EUA donde llegarán todas tus compras.</p>
</span>
</a>
</div>
@gnuget
gnuget / fields.php
Created October 24, 2010 19:56
Get duplicate fields in duplicate groups
<?php
/** in this example my field is dd_field and i can get the index of the groups using a field name
* (http://wiki.magicfields.org/doku.php?id=front-end_functions#getgrouporder)
*/
$grupos = getGroupOrder('dd_field');
/** now, using the index of the groups i can get all the duplicate fields into a group**/
foreach($grupos as $grupo) {
/** get_field_duplicate return a array with all values of a field **/
/**http://wiki.magicfields.org/doku.php?id=front-end_functions#get_field_duplicate**/
$fields = get_field_duplicate('dd_field',$grupo);
#bash completion
if [ -f /usr/local/Cellar/bash-completion/1.2/etc/bash_completion ]; then
. /usr/local/Cellar/bash-completion/1.2/etc/bash_completion
fi
brew install bash-completion
<?php
function multiline_with_more($multiline_name){
global $post;
///Get the content of the multiline custom field
$multiline = get('multiline');
//if the page is_Single we replace the <!--more--> tag for:
//<span id="more-9-{$custom_Field_name"></span>
if(is_single($post->ID)){
preg_match('/(.*)(\<\!\-\-more\-\-\>)(.*)/is',$multiline,$matches);
return $matches[1]."<span id='more-{$post->ID}-{$multiline_name}'></span>".$matches[3];
#! /usr/bin/env python
#http://fitorec.wordpress.com/2009/12/18/deteccion-de-intrusos-en-nuestra-wi-fi/
import urllib2
import re
opener = urllib2.Request('http://home/',None,{})
response = urllib2.urlopen(opener)
response = response.read()
#obteniendo el nombre de las maquinas
#! /usr/bin/env python
# -*- coding: utf-8 -*-
version = "1.0"
__module_name__ = "forceutf-8.py"
__module_version__ = version
import xchat
<?php
function yourfunction($atts) {
//get the value of the custom field.
$value = get("yourfieldname");
return $value;
}
add_shortcode('your_shortcode', 'yourfunction');
?>