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 | |
| /** | |
| * Exemplo de uso: | |
| * | |
| * echo change_str(',', '|', 'a,b,c,d,e', 3); | |
| * >>> 'a,b,c,d|e' | |
| */ | |
| function change_str($str, $replacer, $string, $pos) |
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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> | |
| <title>Select</title> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> | |
| <script src="seu_javascript.js" type="text/javascript"></script> | |
| </head> | |
| <body> | |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <title>Integers</title> | |
| </head> | |
| <body> | |
| <script type="text/javascript"> | |
| Number.prototype.fixIt = function(){ |
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
| pedra, papel, tesoura, lagarto, spok | |
| Regras: | |
| ------- | |
| tesoura corta papel | |
| papel cobre pedra | |
| pedra esmaga lagarto | |
| lagarto envenena spok | |
| spok quebra tesoura |
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
| $especiais = unserialize(PARTICIPANTES_ESPECIAIS); | |
| $parNomeEspecial = isset($participante) | |
| && isset($participante['PARNOME']) | |
| && in_array($participante['PARNOME'], $especiais); | |
| if (!$participante || !$parNomeEspecial): |
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 | |
| $perfil = 'dgmike'; | |
| $saida = file_get_contents("http://util.dgmike.com.br/meadiciona/{$perfil}.json"); | |
| $perfil = json_decode($saida); | |
| if ($perfil->r) { | |
| echo '<h2>'.$perfil->data->nome.'</h2>'; | |
| foreach ($perfil->data->servicos as $servico) { | |
| if (!$servico->url) continue; // Se não tiver a url, não irei exibir | |
| echo "<a href='{$servico->url}' style='float:left; width: 190px; height:35;text-align:center'>"; |
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
| function drawVisualization() { | |
| // Create and populate the data table. | |
| var data = new google.visualization.DataTable(); | |
| data.addColumn('string', 'Ano'); | |
| data.addColumn('number', 'Visualizacoes'); | |
| // [ column, column, ... ] => row | |
| // column pode ser uma String/Int/Float/Date ou o seguinte objeto | |
| // { v: "", p : {} } => column, onde v = valor; p: properties | |
| // http://code.google.com/apis/visualization/documentation/reference.html#cell_object |
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 | |
| $object = array( | |
| array( | |
| 'a' => 'Como vai você?', | |
| 'b' => 'Vou bem', | |
| ), | |
| array( | |
| 'c' => 'E a família', | |
| ), |
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 | |
| class Con extends PDO | |
| { | |
| function Con() | |
| { | |
| self::PDO(CONFIG_DNS, CONFIG_USER, CONFIG_PASS); | |
| } | |
| function get($table, $id) |
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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
| <head> | |
| <title> Stu Nicholls | CSSplay | Centering an image using CSS</title> | |
| <style type="text/css"> | |
| /* for non-IE browsers */ | |
| div.holder {width:748px; height:300px; background:#f8f8f8; border:1px solid #777; text-align:center; display:table-cell; vertical-align:middle;} |