Skip to content

Instantly share code, notes, and snippets.

@visb
visb / gist:7773528
Last active December 30, 2015 04:08
<?php
abstract class TypeObject
{
protected $type;
protected $value;
public function __construct($value)
{
@visb
visb / gist:7989502
Last active December 31, 2015 12:59
pretty checkbox
<html>
<head>
<title></title>
<style type="text/css">
input[type="checkbox"]{
display: none;
}
.pretty-check{
@visb
visb / gist:8021667
Created December 18, 2013 12:40
hack display inline-block IE7
display: inline-block;
*display: inline;
zoom: 1;
<?php
class String
{
protected $value;
public function __construct($value = '')
{
$this->setValue($value);
}
@visb
visb / estrutura-cms
Created January 14, 2014 12:46
Sugestão de estrutura de pastas para o cms
./modules
./moduleName
./Controller
./ControllerName.php
./Model
Model.php
./modules
{{ define modules }}
./assets
./views
@visb
visb / ModelExemplo.js
Created January 30, 2014 12:57
Prévia de model
return $.class({
extends: ['Path/To/ClassToExtend1', 'Path/To/ClassToExtend2'],
implements: ['Path/To/ClassToImplement1'],
fields: {
id: {
type: 'int',
label: '#ID',
},
images: {
<div class="wrapper">
<section class="breadcrumb">
<?php echo $breadcrumb; ?>
</section>
<div class="clear"></div>
<section class="sidebar">
<h3><?php echo $pagina->titulo->valor; ?></h3>
<?php if(count($categorias = $parent->childrens(1,1))){ ?>
<ul>
<?php
class Produtos extends MY_Controller
{
public function __construct()
{
parent::__construct('main');
}
/**
@visb
visb / pcm.html
Last active August 29, 2015 13:56
Rascunho PCM(Parent Children Modifier)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.\#slider {
background: red;
height: 500px;
}
@visb
visb / card_hash_sample
Created February 26, 2014 00:12
Exemplo de como gerar card_hash com a api do pagar.me
<?php
$common = new PagarMe_TransactionCommon;
$common->setCardnumber();
$common->setCardCvv();
// -> setWathever();
// ...
$card_hash = $common->generateCardHash();