Skip to content

Instantly share code, notes, and snippets.

View alexandrecruz's full-sized avatar

Alexandre Cruz alexandrecruz

  • Toronto, ON, Canada
View GitHub Profile
# Essa é a configuração para usar com o AMPPS com MySQL
export PATH="/Applications/AMPPS/php/bin:/Applications/AMPPS/mysql/bin:$PATH"
export PATH=~/.composer/vendor/bin:$PATH
# Esta aqui para voce utilizar os alias do MAMP
export PATH="/Applications/MAMP/bin/php/php5.5.10/bin:$PATH"
export PATH=~/.composer/vendor/bin:$PATH
<?php
class AdminController extends BaseController {
/**
* Controller constructor. Force Token protection,
* and force out-of-filter auth for this
* controller in dashboard page.
*
* @return void
<?php
Route::group(array('domain' => '{account}.myapp.com'), function()
{
// conteúdo aqui
});
class Usuario extends Eloquent {
/**
* Atributo - Magic Method
*
* Intercepta o setter do campo indicado em
* set(Campo)Attribute e executa o código
* antes de inserir o valor no objeto.
*
* @param string $value
@alexandrecruz
alexandrecruz / bettha_detect.js
Created November 9, 2017 14:43
Try to load Youtube iframe
'use strict';
// Youtube avilability detector
// ---
// Cases: $scope.youtubeAvilable
// null - Not completed the request yet
// true - Youtube API and iframe loaded
// false - Youtube API and iframe could not be laoded
$scope.youtubeAvilable = null;
@alexandrecruz
alexandrecruz / php.ini
Last active June 5, 2018 13:20
Setup redis extension in MacOS 10.13+ with PHP 7.1
;extension=php_mbstring.dll
;extension=php_exif.dll ; Must be after mbstring as it depends on it
;extension=php_mysqli.dll
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
;extension=php_odbc.dll
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
@alexandrecruz
alexandrecruz / .php-cs-fixer.php
Created May 24, 2022 13:37 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',