Skip to content

Instantly share code, notes, and snippets.

View luisdalmolin's full-sized avatar
👨‍💻

Luís Dalmolin luisdalmolin

👨‍💻
View GitHub Profile
<?php
$str = "Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός";
$str = mb_strtolower($str, 'UTF-8');
echo $str; // Prints τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός
@luisdalmolin
luisdalmolin / index.html
Created June 19, 2012 02:14
Carregando os gists por ajax
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Carregando GIST's por ajax</title>
<style type="text/css">
body {
font-family: Helvetica, sans-serif;
font-size: 13px;
@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@escape.ppg.br>
*/
class NomeDaClasse extends EscapeWork
{
@luisdalmolin
luisdalmolin / controller.php
Created September 25, 2012 01:39
EscapeWork: Controller
<?php
/**
* Controlador da página ...
*
* @author ... <email@escape.ppg.br>
*/
if( !defined('ESCAPEWORK') ) {
exit();
<?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 <luis@escape.ppg.br>
# 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"