Skip to content

Instantly share code, notes, and snippets.

View caironoleto's full-sized avatar

Cairo Noleto caironoleto

View GitHub Profile
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
require_once("Lumine.php");
/**
* Generates object of the configuration of lumine
$lumineConfig["host"] = "";
$lumineConfig["user"] = "";
$lumineConfig["password"] = "";
$lumineConfig["database"] = "";
$lumineConfig["dialect"] = "MySQL";
$lumineConfig["port"] = "3306";
$lumineConfig["class_path"] = APPPATH;
$lumineConfig["package"] = "models";
$lumineConfig["options"]["schema_name"] = "";
# CAPITULO 5 - http://why.nomedojogo.com/chapter-5.html
# 5. O Roubo do Capitão Loteria
# OBS: Alguém poderia me explicar?
##########################################################################################################
elsif numeros_escolhidos.detect { |p| not INTERVALO_NUMERICO === p }
raise ArgumentError, "os três escolhidos devem ser números entre 1 e 25."
end
# Dúvida: o que o .detect faz? e como eu leria esse trecho de código? { |p| not INTERVALO_NUMERICO === p }
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class MY_Loader extends CI_Loader {
public $layout = "application";
function MY_Loader() {
parent::CI_Loader();
}
function setLayout($layout) {
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Titulo </title>
</head>
class SkatingContest
def o_vencedor; @o_vencedor; end
def o_vencedor=( nome )
unless nome.respond_to? :to_str
raise ArgumentError, "O nome do vencedor deve ser uma String,
não um prooblema matemático ou uma lista de nomes ou qualquer ou
coisa parecida."
end
@o_vencedor = nome
end
<html>
<head>
<title>Welcome to CodeIgniter</title>
<style type="text/css">
body {
background-color: #fff;
margin: 40px;
font-family: Lucida Grande, Verdana, Sans-serif;
font-size: 14px;
color: #4F5155;
cairo@lt:~/Workspace/cake/test$ phpunit --testdox AllTests.php
PHPUnit 3.3.2 by Sebastian Bergmann.
Generate
[x] Create a welcome controller
[x] If content of welcome controller is welcome class
[x] Create a user controller
[x] Create a user controller and index view
[x] If content of user controller is user class
[x] If create a index method in welcome controller
'User remembers me until one week' FAILED
expected: Sat, 29 Nov 2008 17:22:51 UTC +00:00,
got: Sat, 29 Nov 2008 17:22:51 UTC +00:00 (using ==)
spec/models/user_spec.rb:225:
spec/models/user_spec.rb:8:
#Usage with CodeIgniter
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>