Skip to content

Instantly share code, notes, and snippets.

View patrickmaciel's full-sized avatar
🙏
Jesus is coming!

Patrick Maciel patrickmaciel

🙏
Jesus is coming!
View GitHub Profile
@patrickmaciel
patrickmaciel / BaseController.php
Created March 17, 2015 19:23
Laravel 4.2 ResponseBuilder - manipulando o render e redirect baseado no tipo de requisição
<?php
use Illuminate\Routing\Controller;
use Libraries\Wrappers\http\ResponseBuilder;
abstract class BaseController extends Controller
{
/**
* The response builder that is going to be used in order to prepare
* action responses
@patrickmaciel
patrickmaciel / DatabaseSeeder.php
Last active August 29, 2015 14:17
SQL Server DatabaseSeeder and Seeders in Laravel 4.2
<?php
class DatabaseSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
<?php
use App\Services\Validators\Admin\MailingValidator;
class MailingsController extends \BaseController
{
/**
* Display a listing of the resource.
* GET /mailings
@patrickmaciel
patrickmaciel / nginx.conf
Last active August 29, 2015 14:20
nginx.conf with autoindex and *.conf includes
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@patrickmaciel
patrickmaciel / Keybinds.sublime-settings
Created May 15, 2015 14:38
Sublime Text preferences - Old Work
[
{
"keys": ["ctrl+shift+j","ctrl+shift+j"],
"command": "javatar",
"args": {
"action": {
"name": "main"
}
}
},
@patrickmaciel
patrickmaciel / gist:c3c26858b2aeace26692
Created September 29, 2015 00:03 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@patrickmaciel
patrickmaciel / README.md
Created September 30, 2015 02:16 — forked from jonathantneal/README.md
SASS @font-face mixin

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@patrickmaciel
patrickmaciel / iterate.php
Last active November 10, 2015 17:19
Snippet: PHP - Iterate specific file by extension - PHP
<?php
$iterator = new \GlobIterator(YOUR_PATH_HERE . '/*.xls', \FilesystemIterator::KEY_AS_FILENAME);
$array = iterator_to_array($iterator);
foreach ($array as $file) {
echo $file->getFileName() . '<br>';
}
@patrickmaciel
patrickmaciel / Snippet: PHP - Iterate Files by Extension
Created November 10, 2015 17:12
Iterate files by extension in specific folder
$this->info(base_path() . '/*.xls');
$iterator = new \GlobIterator(base_path() . '/*.xls', \FilesystemIterator::KEY_AS_FILENAME);
$array = iterator_to_array($iterator);
foreach ($array as $file) {
echo $file->getFileName();
}
@patrickmaciel
patrickmaciel / osx-homebrew-setup.md
Created December 9, 2015 18:14 — forked from sr75/osx-homebrew-setup.md
Mac Yosemite OSX - Homebrew (RVM/MySQL/Redis) setup

Mac Homebrew (RVM/MySQL/Redis) setup

Follow the steps below to setup a local development environment:

XQuartz

Recommended to download latest XQuartz

iTerm2