#Mac OS X
This file contains 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
/* objetos */ | |
// literal notation | |
var calendar = { | |
name: "PHP Event", | |
year: 2012 | |
}; | |
// constructor | |
var pets = {}; | |
// OU |
This file contains 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
/* | |
* Faça um programa que dê o conteito do aluno conforme sua nota média. | |
* | |
* Entrada: 3 notas | |
* Saída: média das notas e o conceito | |
* | |
* caso 0 <= média < 4 -> Nota E | |
* caso 4 <= média < 5 -> Nota D | |
* caso 5 <= média < 7 -> Nota C | |
* caso 7 <= média < 8 -> Nota B |
This file contains 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 | |
session_start(); | |
$_SESSION['count'] = time(); | |
$image; | |
?> | |
<title>demo.php</title> | |
<body style="background-color:#ddd; "> | |
<?php |
This file contains 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
class Bootstrap { | |
function __construct() { | |
$url = isset($_GET['url']) ? explode('/', rtrim($_GET['url'], '/')) : null; | |
if( empty($url[0]) ) { | |
$url[0] = 'index'; // default value | |
} |
This file contains 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 TableRII extends RecursiveIteratorIterator { | |
private $parentKey = null; | |
public function beginIteration() { | |
echo '<table border=1><tr><th>key</th><th>value</th></tr>'; | |
} | |
public function endIteration() { | |
echo '</table>'; |
This file contains 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 | |
// Script para demonstrar o loop infinito em PHP sem travar | |
while (true) { | |
puts "Ola, eu estou em loop!<br />"; // troque essa linha pelo seu loop real | |
flush(); | |
sleep(1); | |
} |
This file contains 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
{ | |
"estados": [ | |
{ | |
"sigla": "AC", | |
"nome": "Acre", | |
"cidades": [ | |
"Acrelândia", | |
"Assis Brasil", | |
"Brasiléia", | |
"Bujari", |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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 | |
/** | |
* Created by JetBrains PhpStorm. | |
* User: amezghal abdelilah | |
* Date: 17/09/13 | |
* Time: 11:08 | |
*/ | |
class AjaxBase { | |
public function executeAction($actionName, $arguments = []){ |