Skip to content

Instantly share code, notes, and snippets.

@luisdalmolin
luisdalmolin / openstack.php
Created July 17, 2012 17:12
Congrats to Openstack
<?php
interface Congratulations
{
public function congrats();
}
class OpenStack implements Congratulations
{
static $instance;
@luisdalmolin
luisdalmolin / baseclass.php
Created September 25, 2012 01:34
EscapeWork: Base Class
<?php
/**
* Description
*
* @author Seu nome <[email protected]>
*/
class NomeDaClasse extends EscapeWork
{
@luisdalmolin
luisdalmolin / controller.php
Created September 25, 2012 01:39
EscapeWork: Controller
<?php
/**
* Controlador da página ...
*
* @author ... <[email protected]>
*/
if( !defined('ESCAPEWORK') ) {
exit();
@luisdalmolin
luisdalmolin / regexp-name-id.md
Created November 6, 2012 16:37
Remove name and ID attribute

Removendo todos os atributos name e ID

  • \s*(name|id)="[^"]+"\s*
  • # (1 espaço)

Adicionando style="display: block"

  • \s*(border)="[^"]+"\s*
  • border="0" style="display: block"
<?php
class SkuValueController extends BaseController
{
public function update( SkuRepositoryInterface $sku, $id )
{
}
}
<?php
App::bind('product', function($value, $route)
{
var_dump( $value ); die;
});
Route::get('produtos/{product}/skus', array('as' => 'produtos.skus.index', 'uses' => 'ProductSkuController@index'));
<?php
class Slug
{
/**
* Create a URI friendly slug from a string.
*
* @param string $uri
* @return string
*/
public static function make($uri)
@luisdalmolin
luisdalmolin / ClientAuth.php
Last active December 15, 2015 02:28
Some thoughts about the Laravel Auth. The only real changes is the new method getModel in EloquentUserProvider (need to add in DatabaseUserProvider too), and the methods `getName` and `getRecallerName` in the `Guard` class, to make the session name with the related model.
<?php namespace Commerce\Client\Facades;
class ClientAuth
{
/**
* @var Illuminate\Auth\Guard
*/
static $guard;
@luisdalmolin
luisdalmolin / config.rb
Created April 15, 2013 18:10
Compass file configuration
# Arquivo de configuração do Compass para o EscapeWork (a partir de versão 1.3, que contém o sass)
# Versões anteriores vão precisar criar e cofigurar os diretórios do sass e css
# Author: Luís Dalmolin <[email protected]>
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = ""
css_dir = "assets/css"
sass_dir = "assets/css/scss"