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 | |
$i=1; | |
//lerDiretorio("uploads", $i); | |
$file = "uploads"; | |
$o = "teste.txt"; | |
lerDiretorio($file, $o); | |
function lerDiretorio($dirname, $todos) |
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
public function isValid(){ | |
if(!isset(Thread::$rules) | |
return true; | |
$validator = Validator::make( | |
$this->attributes, | |
static::$rules | |
); | |
if(Validator->fails()) |
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
class Pessoa extends Eloquent { | |
protected $table = "pessoa"; | |
public function telefones() | |
{ | |
return $this->hasMany('Telefone', 'id_pessoa'); | |
} |
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 if (!defined('BASEPATH')) exit('No direct script access allowed'); | |
/** | |
* MY_Form_validation Class | |
* | |
* Extends Form_Validation library | |
* | |
*/ | |
class MY_Form_validation extends CI_Form_validation { | |
function __construct() |
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
import java.io.BufferedWriter; | |
import java.io.File; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.util.Scanner; | |
public class Exercicio { | |
/** |
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
class Entrada | |
def initialize(linha) | |
linha = linha.split(',') | |
@numero = linha[0] | |
@operacao=linha[1] | |
@classificacao=linha[2] | |
@valor=linha[3].to_f | |
@valor_imposto=linha[4].to_f | |
end |
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
$server = "(local)\SQLEXPRESS"; | |
$username = "sa"; | |
$password = "weak"; | |
try | |
{ | |
$conn = new PDO("sqlsrv:server=$server;Database=MyDB", $username, $password); | |
} | |
catch (PDOException $e) | |
{ | |
echo 'Connection failed: ' . $e->getMessage(); |
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
header("Content-type: text/csv"); | |
header("Cache-Control: no-store, no-cache"); | |
header('Content-Disposition: attachment; filename="filename.csv"'); | |
$outstream = fopen("php://output",'w'); | |
$test_data = $this->declarante_model->teste(); | |
foreach( $test_data as $row ){ | |
fputcsv($outstream, $row, ';', '"'); |
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
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 7E492AAE24DF7CC4 |
NewerOlder