Skip to content

Instantly share code, notes, and snippets.

View ipalaus's full-sized avatar

Isern Palaus ipalaus

View GitHub Profile
@ipalaus
ipalaus / webpack.mix.js
Created November 19, 2017 16:55 — forked from andrewdelprete/webpack.mix.js
Laravel Mix: Tailwind CSS + PurgeCSS Example
let mix = require("laravel-mix");
let tailwindcss = require("tailwindcss");
let glob = require("glob-all");
let PurgecssPlugin = require("purgecss-webpack-plugin");
/**
* Custom PurgeCSS Extractor
* https://github.com/FullHuman/purgecss
* https://github.com/FullHuman/purgecss-webpack-plugin
*/
git remote add laravel https://github.com/laravel/laravel.git
git pull laravel
git merge laravel/develop --squash
<?php
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.

After an apt-get upgrade on my Forge box, both php and nginx got upgraded, and while browsing my sites, PHP FPM was being hit by nginx, but it returned nothing, zilch, nada.

Nothing on laravel.log.

Something in the nginx log:

10.10.10.10 - - [23/Sep/2014:11:52:09 -0300] "GET / HTTP/1.1" 200 31 "-" "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
@ipalaus
ipalaus / ApiController.php
Last active August 17, 2018 23:06
Using cursor instead of pagination with Fractal. IE: GET /users?cursor=5
<?php
use League\Fractal\Manager;
use League\Fractal\Resource\Collection;
use League\Fractal\Resource\Item;
use League\Fractal\Cursor\CursorInterface;
class ApiController extends Controller
{
@@ -15,7 +15,11 @@ class DatabaseSeederTest extends PHPUnit_Framework_TestCase {
{
$seeder = new Seeder;
$seeder->setContainer($container = m::mock('Illuminate\Container\Container'));
- $seeder->setCommand($command = m::mock('Illuminate\Console\Command'));
+ $output = m::mock('Symfony\Component\Console\Output\OutputInterface');
+ $output->shouldReceive('writeln')->once()->andReturn('foo');
+ $command = m::mock('Illuminate\Console\Command');
+ $command->shouldReceive('getOutput')->once()->andReturn($output);
+ $seeder->setCommand($command);
@ipalaus
ipalaus / BigLog.php
Last active February 14, 2023 13:10
Eloquent handler for Monolog.
<?php namespace BigBrother\Support\Facades;
use Illuminate\Support\Facades\Facade;
class BigLog extends Facade {
/**
* Get the registered name of the component.
*
* @return string
@ipalaus
ipalaus / innobackupex-restore.sh
Created December 7, 2012 10:04 — forked from dalecaru/innobackupex-restore.sh
Scripts to create and restore full and incremental backups (for all databases on server) using innobackupex from Percona.
#!/bin/sh
#
# Script to prepare and restore full and incremental backups created with innobackupex-runner.
#
# This script is provided as-is; no liability can be accepted for use.
#
INNOBACKUPEX=innobackupex-1.5.1
INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX
TMPFILE="/tmp/innobackupex-restore.$$.tmp"