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 | |
function GeneratePassword($length,$caracteres){ | |
$password = ""; | |
$length_c = strlen($caracteres); | |
while(strlen($password) < $length){ | |
$pos = rand( 0 , $length_c - 1 ); | |
$password .= $caracteres[$pos]; | |
} | |
return $password; |
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
dev = 0; | |
bus = 0; | |
devbus = 0; | |
for(i=1;i<101;i++){ | |
if(i%3 == 0 && i%5 == 0){ | |
document.write( i + ' - devbus<br/>'); | |
devbus++; | |
} | |
if(i%3 == 0){ | |
document.write( i + ' - dev<br/>'); |
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 | |
function getURLFull() { | |
$pageURL = 'http'; | |
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} | |
$pageURL .= "://"; | |
if ($_SERVER["SERVER_PORT"] != "80") { | |
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; | |
} else { | |
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; | |
} |
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 | |
// Inicio do arquivo omitido | |
/* | |
* Detectar domínio no Laravel 4.1 e aplicar o ambiente correspondente | |
*/ | |
$env = $app->detectEnvironment(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
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| Delete form macro | |
|-------------------------------------------------------------------------- | |
| | |
| This macro creates a form with only a submit button. | |
| We'll use it to generate forms that will post to a certain url with the DELETE method, | |
| following REST principles. |
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 | |
View::composer(Paginator::getViewName(), function($view) { | |
$query = array_except( Input::query(), Paginator::getPageName() ); | |
$view->paginator->appends($query); | |
}); |
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 namespace Fhferreira\Zodiac; | |
//File: workbench\fhferreira\zodiac\src\Fhferreira\Zodiac\Zodiac.php | |
class Zodiac{ | |
/** | |
* @var \DateTime | |
*/ | |
protected $date; | |
/** |
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 | |
//Last Queries | |
$queries = DB::getQueryLog(); | |
$last_query = end($queries); | |
dd($last_query); | |
//or All Queries | |
$queries = DB::getQueryLog(); | |
dd($queries); | |
//or All Queries and bindings in the string | |
$queries = DB::getQueryLog(); |
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 | |
function calcutateAge($birthday){ | |
$birthday = date("Y-m-d",strtotime($birthday)); | |
$birthdayObject = new DateTime(birthday); | |
$nowObject = new DateTime(); | |
$diff = $birthdayObject->diff($nowObject); |
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 | |
function palindromes($words) { | |
$str = ""; | |
// Write your code here | |
foreach($words as $word){ | |
if( $word == strrev($word) ){ | |
$str .= 'T'; | |
}else{ | |
$str .= 'F'; | |
} |