Skip to content

Instantly share code, notes, and snippets.

View gnuget's full-sized avatar

David Valdez gnuget

View GitHub Profile
@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);
<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 / 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
@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 / gist:1191968
Created September 3, 2011 23:55
Ejemplo de como cambiar la aplicación para cargar una vista
<?php
/**
* Access from index.php:
*/
if(!defined("_access")) {
die("Error: You don't have permission to access here...");
}
class Hello_Controller extends ZP_Controller {
@gnuget
gnuget / gist:1196653
Created September 6, 2011 05:16
Nginx Configuration for zanphp (https://github.com/MilkZoft/ZanPHP )
server {
listen 80;
server_name zanphp.dev;
roto /path/to/project/zanphp; #change this for the location of your project
index index.php;
if (!-f $request_filename) {
rewrite ^/(.+)$ /index.php?/$1 last;
break;
}
"set guifont=Inconsolata:h13
set guifont=Monaco:h12
set guioptions-=T
set background=dark
macm Window.Select\ Previous\ Tab key=<D-M-Left>
macm Window.Select\ Next\ Tab key=<D-M-Right>
"Sin sonido
set noerrorbells visualbell t_vb=
autocmd GUIEnter * set visualbell t_vb=
@gnuget
gnuget / gist:1532008
Created December 29, 2011 05:00
Cambiar el tema en Drupal 6
<?php
function yourcustommodule_init(&$vars) {
global $custom_theme;
$custom_theme = 'new-theme'; //El nombre del tema a desplegarse
init_theme();
}
}
?>
@gnuget
gnuget / ackrc
Created April 5, 2012 03:17
mi ackrc
--pager=less -R
--type-add=php=.module
--type-add=php=.inc
@gnuget
gnuget / vimrc
Created October 4, 2014 00:44
David's vimrc
syntax on
" Usando features exclusivas de VIM que no tiene VI
set nocompatible
set showmatch " Matching brackets.
set ignorecase " Do case insensitive matching
set incsearch " Incremental search
set ruler " show the line number on the bar
set autoread " watch for file changes
set scrolloff=10
set guifont=Monaco:h12