Skip to content

Instantly share code, notes, and snippets.

@fabriziomachado
fabriziomachado / database.php
Created September 5, 2011 23:00
application/config/database.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
#$active_group = 'default';
$enviroment = 'default';
if (ENVIRONMENT === 'testing') $enviroment .= '_test';
$active_group = $enviroment;
$active_record = TRUE;
// production enviromment
@fabriziomachado
fabriziomachado / MY_Controller.php
Created December 9, 2011 22:27
application/core/MY_Controller.php
<?php
class MY_Controller extends CI_Controller
{
#public $layout = 'default';
public $title = 'Unesc - Universidade do Extremo Sul Catarinense';
public $css = array('application','libs/blueprint/screen',
'libs/jquery-ui-1.8.16.custom','libs/ui.notify');
public $js = array('libs/modernizr-2.0.6',
'libs/jquery-1.6.2.min', 'libs/jquery-ui-1.8.16.custom.min',
@fabriziomachado
fabriziomachado / azure-pipelines.yml
Created September 7, 2021 17:08 — forked from zanechua/azure-pipelines.yml
Azure Pipeline + Laravel + MySQL + PHPUnit + Laravel Dusk
# PHP
# Test and package your PHP project.
# Add steps that run tests, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/php
pool:
vmImage: 'Ubuntu 16.04'
variables:
phpVersion: 7.2
@fabriziomachado
fabriziomachado / tests.yml
Created December 17, 2019 11:37 — forked from rubenvanassche/tests.yml
A simple Laravel testing workflow for GitHub Actions
name: Tests (PHP)
on: [push]
jobs:
tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
@fabriziomachado
fabriziomachado / mobiletheme.css
Last active September 26, 2018 19:04
mobiletheme.css
.bar-header {
background-color: #5069A1;
}
ion-side-menu li .item {
background-color: #313848;
border-color: #4F5865;
color: #BCC3CF;
}
@fabriziomachado
fabriziomachado / nginx.default.conf
Created June 1, 2018 21:56 — forked from sumardi/nginx.default.conf
Install PHP-FPM, Nginx & MySQL on EC2 with Amazon Linux AMI
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and PHP-FPM
sudo yum install -y nginx php-fpm
# Install PHP extensions
sudo yum install -y php-devel php-mysql php-pdo \
php-pear php-mbstring php-cli php-odbc \
version: '2'
services:
nginx:
image: nginx
restart: always
hostname: loadbalancer
ports:
- "80:80"
- "443:443"
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
class DoctrineServiceProvider extends ServiceProvider
{
<?php
class Arrays{
/**
* Sample $obj = Users::all();
* @param Object(Eloquent) $obj
* Key usage for assoc with value in the array $data
* @param string $key
* Value usage for fill array $data
* @param string $value
* Enable first element
@fabriziomachado
fabriziomachado / omniauth.rb
Created December 21, 2011 23:18 — forked from dira/omniauth.rb
OmniAuth strategy for a custom provider
# config/initializers/omniauth.rb
module OmniAuth
module Strategies
# tell OmniAuth to load our strategy
autoload :Pixelation, 'lib/pixelation_strategy'
end
end
Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, "app_name", "secret"