Skip to content

Instantly share code, notes, and snippets.

@stephandesouza
stephandesouza / 0_reuse_code.js
Created November 20, 2013 01:31
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@stephandesouza
stephandesouza / gist:6820103
Last active December 24, 2015 15:29
PHP: Extract + List // Lat Lang Geo
<?php
list($lat, $lon) = explode(',', '-22.903322,-43.173098');
echo $lat; //-22.903322
echo $lon; //-43.173098
@stephandesouza
stephandesouza / Exemplo Chamada
Last active December 22, 2015 06:18
Exemplo de como chamar um formulário/include usando shortcode
[include_form template="contato" titulo="Formulário de Contato"]
// É feito o include do arquivo "forms/contato.php", com uma variável $titulo, com valor "Formulário de Contato"
@stephandesouza
stephandesouza / includes-advert.class.php
Last active December 16, 2015 09:49
Better jQuery Support on ML Advert Wordpress Plugin http://wordpress.org/extend/plugins/ml-adverts
<?php
/*
* With this we remove all not necessary HTML Tags for the URL and use the Title attr, also add a "ml-advert" metada for jQuery on() control
Where:
$ret_val = "<a" .
" href='" . MLA_BASE_URL . "out.php?id=" . $this->get_advert_id() . "'" .
" onmouseover='maskLink(this,event,\"" . $url_mask . "\")'" .
" onclick='maskLink(this,event,\"" . $url_mask . "\")'" .
" onmouseout='maskLink(this,event,\"" . $url_mask . "\")'" .
@stephandesouza
stephandesouza / example.php
Created October 18, 2012 21:08
Recursively map a string function from a array/object
<?php
//Array from JSON Webservice
$array = array();
//Decoding all values from UTF-8
str_recursive_map('utf8_decode',$array);
//Applying htmlentities ( Good for other charset )
str_recursive_map('htmlentities',$array);