Skip to content

Instantly share code, notes, and snippets.

View vinicius73's full-sized avatar
🤓
"Those who cannot acknowledge themselves, will eventually fail."

Vinicius Reis vinicius73

🤓
"Those who cannot acknowledge themselves, will eventually fail."
View GitHub Profile
@vinicius73
vinicius73 / material-laravel.md
Last active August 28, 2015 16:18 — forked from rafa-acioly/material-laravel.md
Todos os links abaixo contem conteudo em texto e video para estudo do framework Laravel, aproveite com moderação.
@vinicius73
vinicius73 / cache.php
Created February 27, 2014 14:07
Load relations com cache Laravel
<?php
$query = MyModel::orderBy('name', 'ASC');
//Sem cache
$query->with('relation1','relation2');
//Com Cache
$query->with(
[
@vinicius73
vinicius73 / base64url.php
Created March 17, 2014 15:12
Encripta dados para serem usados em urls
<?php
function base64url_encode($data) {
return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
}
function base64url_decode($data) {
return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT));
}
@vinicius73
vinicius73 / CategoryRepository.php
Created March 25, 2014 21:06
Modelo de Repository [LARAVEL]
<?php
namespace MyApp\Repository;
use MyApp\Category;
class CategoryRepository
{
/**
* @return \Illuminate\Database\Eloquent\Collection|static[]
@vinicius73
vinicius73 / gist:9892161
Created March 31, 2014 13:24
Shortcodes para Emmet

#wordpress sidebar widget

section.widget>(header>h2)+div.inner-widget
section.widget>(header>h2)+div.inner-widget+footer

@vinicius73
vinicius73 / button_shortcode.php
Created May 15, 2014 15:06
Shortcode para Botão
<?php
function shortcode_btn($atts)
{
$atts = shortcode_atts(array('url' => 'javascript:;', 'target' => '_top', 'name' => NULL), $atts);
$url = $atts['url'];
$target = $atts['target'];
$name = (is_null($atts['name'])) ? $url : $atts['name'];
return "<a href='" . $url . "' target='" . $target . "' class='btn btn-alt' >" . $name . "</a>";
@vinicius73
vinicius73 / paginator.php
Created June 10, 2014 10:42
classe de paginação para wordpress [beta]
<?php
class WP_CustomPagination
{
protected $args = array();
protected $wp_query, $paged, $pages, $range, $showItens, $element = null;
public static $argsDefault = array(
'before' => '<ul class="pagination %1$s">',
'after' => '</ul>',
{
"name": "meunome/meutema",
"description": "minha descricao",
"license": "proprietary",
"authors": [{
"name": "Vinicius Reis",
"email": "luiz.vinicius73@gmail.com"
}],
"require": {
"potterywp/potter": "dev-master"
$image = Input::file('im');
$model = new \Artesaos\Attacher\AttacherModel();
$model->setupFile($image);
$model->save();
@vinicius73
vinicius73 / FrontCtrl.php
Created May 6, 2015 18:02
Como organizar: Painel e Front no Laravel 5 (Controllers)
# app/http/controllers/front
<?php namespace App\Http\Controllers\Front;
use App\Http\Controllers;
abstract class FrontCtrl extends Controllers
{
}