Skip to content

Instantly share code, notes, and snippets.

<?
define('ORA_CHARSET_DEFAULT', 'SPANISH_SPAIN.AL32UTF8');
define('ORA_CONNECTION_TYPE_DEFAULT', 1);
define('ORA_CONNECTION_TYPE_PERSISTENT', 2);
define('ORA_CONNECTION_TYPE_NEW', 3);
define('ORA_MESSAGES_NOT_CONNECTED', 'Not connected to Oracle instance');
class ORACLE {
private static $_instance;
private $conn_handle;
/*
* params $file // Arquivo $_FILES
* params $diretoio // Diretório raiz do www + pasta (saocamilo/ + ... )
* params $nome // Nome customizado para o arquivo, padrão hash_files()
*/
Upload::criar( $file, $diretorio, $nome = NULL);
// Envia os dados com o upload
$http({
method: 'POST',
url: ,
headers: { 'Content-Type': undefined },
transformRequest: function(data) {
var formData = new FormData();
formData.append("post", angular.toJson(data.post));
// Agora add os arquivos
$("#search").keyup(function(){
_this = this;
// Mostrando apenas as linhas que combinam e escondendo o restante
$.each($("#table tbody tr"), function() {
if($(this).text().toLowerCase().indexOf($(_this).val().toLowerCase()) === -1)
$(this).hide();
else
$(this).show();
});
});
@PabloPG
PabloPG / converter.php
Created October 13, 2015 16:28
Converter number para string
public function convert_number_to_words($number)
{
$hyphen = '-';
$conjunction = ' and ';
$separator = ', ';
$negative = 'negative ';
$decimal = ' point ';
$dictionary = array(
0 => 'zero',
@PabloPG
PabloPG / gist:0a4060cc702d3eb7f6c1
Created June 25, 2014 20:21
Bcrypt para PHP < 5.5
<?php defined('SYSPATH') or die('No direct script access.');
abstract class Bcrypt {
// blowfish
private static $algo = '$2a';
// Parametro de custo
private static $custo = '$10';