Skip to content

Instantly share code, notes, and snippets.

View silasrm's full-sized avatar

Silas Ribas Martins silasrm

View GitHub Profile
SELECT col1, col2, @pv:=col3 AS 'col3' FROM table1 JOIN (SELECT @pv:=1)tmp WHERE col1=@pv
@silasrm
silasrm / new_gist_file.js
Created September 28, 2013 14:45
Cookies em javascript
/*
Exemplo:
- Cria o cookie 'CookieTeste' com o valor 'HellowWorld!' que irá expirar quando o browser for fechado.
GerarCookie('CookieTeste', 'HellowWorld!', 0);
- Lê o conteúdo armazenado no cookie.
LerCookie('CookieTeste');
- Exclúi o cookie.
ExcluirCookie('CookieTeste');
*/
controller:
public function buscaItensAction()
{
$query = $this->getRequest()->getParam('q');
$limit = $this->getRequest()->getParam('limit');
$reg = $this->model->buscaSelect(
$query,
$limit,
<?php
class CORE_Plugin_PagSeguro extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
require_once 'PagSeguroLibrary/PagSeguroLibrary.php';
return $request;
}
@silasrm
silasrm / gist:7877911
Last active December 30, 2015 19:59 — forked from anonymous/gist:7875406
<?php
require('../../dts/dbaSis.php');
require('../../dts/getSis.php');
require('../../dts/setSis.php');
require('../../dts/outSis.php');
$acao = ($_POST['acao'] ? $_POST['acao'] : $_GET['acao']);
$acao = mysql_real_escape_string($acao);
@silasrm
silasrm / gist:7878049
Last active December 30, 2015 19:59 — forked from anonymous/gist:7875395
<div id="box-pedido-produto-1" class="linhas">
<span>
Produto
<a href="#" class="removerCampo" data-id="box-pedido-produto-1"><img src="ico/no.png" class=" pedido-no" /></a>
</span>
<input type="text" class="produto_autocomplete produto" name="produto[]" data-count="1" />
<div id="produto_qv-1"></div>
</div>
@silasrm
silasrm / gist:7878113
Last active December 30, 2015 19:59 — forked from anonymous/gist:7875399
$(function () {
var contadorCamposAdicionar = 1;
removeCampo('box-pedido-produto-1');
function removeCampo(idNovoCampo) {
var novoCampo = $('#'+idNovoCampo+' a.removerCampo');
novoCampo.unbind("click");
#############################################################################
## data source definitions
#############################################################################
source users
{
# data source type. mandatory, no default value
# known types are mysql, pgsql, mssql, xmlpipe, xmlpipe2, odbc
type = mysql

Keybase proof

I hereby claim:

  • I am silasrm on github.
  • I am silasrm (https://keybase.io/silasrm) on keybase.
  • I have a public key whose fingerprint is 5A02 6B0D 749F 6E2F 7342 A708 72E2 3594 0EF4 5BFE

To claim this, I am signing this object:

AddType application/vnd.ms-fontobject .eot
AddType font/truetype .ttf
AddType font/opentype .otf
AddType font/opentype .woff
AddType image/svg+xml .svg .svgz
AddEncoding gzip .svgz
<FilesMatch "\.(ttf|otf|eot|woff|svg)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"