Skip to content

Instantly share code, notes, and snippets.

View rbarros's full-sized avatar

Ramon Barros rbarros

  • Tr4ctor Soluções Inteligentes
  • Brazil
View GitHub Profile
@rbarros
rbarros / consulta_horarios_m.php
Created March 15, 2012 19:00
Update YQL Json
<?php
class consulta_horarios_m extends CI_Model
{
public function get_horarios()
{
$this->update_horarios();
$this->db->select('*');
@rbarros
rbarros / Thumb.php
Created March 15, 2012 21:25
Thumb with crop image
<?
# Arquivo: thumb.php
# Autor: Helbert Fernandes - estaleiroweb
# baseado no trabalho de Mauricio Wolff
include "fileinc.php"; // Inclusão de funcões de Caminho e Diretório
// Constantes: variaveis que não mudam em todo o programa
define('MAX_WIDTH' , (isset($_REQUEST['w']))?$_REQUEST['w']:700);
define('MAX_HEIGHT', (isset($_REQUEST['h']))?$_REQUEST['h']:700);
define('CROP_WIDTH', (isset($_REQUEST['cropw']))?$_REQUEST['cropw']:MAX_WIDTH);
@rbarros
rbarros / index.html
Created March 16, 2012 14:34
Edit elements with javascript
<html>
<head>
<title></title>
</head>
<body>
<table width="676">
<tr>
<td width="241">
<div id="nome_cliente" class="editCampo">
<b>Cliente:</b><br clear="all" />
@rbarros
rbarros / teste1.php
Created March 30, 2012 00:31
String2Int
<?php
$data = "abc def ";
echo $strlen = strlen( $data );
echo "<br/>";
echo $c = $strlen/3;
echo "<br/>";
echo $w = ceil( $c );
echo "<br/>";
echo $h = ceil( sqrt( $w /3 ) );
echo "<br/>";
@rbarros
rbarros / popup.js
Created May 10, 2012 21:36
Inserir popup dinamicamente com javascript
/**
* Popup javascript sem depender do jQuery
*
*/
var popup = {
img:'', // new Array()
img_close:'popup/close2.png',
style:'', //new Array(),
config:function(){
@rbarros
rbarros / lib.js
Created May 23, 2012 16:19
Template para criação de Plugins e Bibliotecas javascript
/*!
* Name JavaScript Plugin/Library v0.0.0
* http://public.ramon-barros.com/
*
* Copyright 2012, Ramon Barros
* Licensed
*
* Includes .js
* http://.com/
* Copyright 2011,
@rbarros
rbarros / ajax.js
Last active April 5, 2016 20:18
Ajax
/*!
* Ajax JavaScript Library v0.5.12
* http://public.ramon-barros.com/
*
* Copyright 2012, Ramon Barros
* Licensed
*
* Includes ajax.js
* http://.com/
* Copyright 2012,
@rbarros
rbarros / newsletter.js
Created May 23, 2012 21:42
Newsletter
/*!
* Newsletter JavaScript Library v0.5.12
* http://public.ramon-barros.com/
*
*
* Copyright (c) 2012 Ramon Barros and other contributors,
* http://ramon-barros.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@rbarros
rbarros / popup.js
Created May 24, 2012 13:35
Popup javascript
/*!
* PopUp JavaScript Plugin v0.8.12
* http://public.ramon-barros.com/
*
* Copyright (c) 2012 Ramon Barros and other contributors,
* http://ramon-barros.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
@rbarros
rbarros / class.js
Created May 25, 2012 02:08
Exemplo de prototype apply e zInherit
/* Exemplos classes prototype
* Este é o JavaScript Scratchpad.
*
* Forneça algum JavaScript, clique com o botão direito ou selecione o menu Execução:
* 1. Executar o texto selecionado,
* 2. Inspecionar: abra o resultado em uma janela “Inspecionar objeto”
* 3. Visualizar: insira o resultado em um comentário depois da selecão.
*/
/*------------------------------------------------------------------------------