Skip to content

Instantly share code, notes, and snippets.

View mspivak's full-sized avatar

Mauro Spivak mspivak

  • Buenos Aires, Argentina
View GitHub Profile
@mspivak
mspivak / AuthController.php
Created September 21, 2016 20:15
Alternative to layerhq/layer-identity-token-php that works on Laravel 4.2
<?php
use Namshi\JOSE\JWS;
class AuthController extends Controller {
function layer_identity_token() {
if (Auth::user()->id !== Input::get('user_id')) {
App::abort(500);
@mspivak
mspivak / Arendt.php
Last active December 24, 2015 14:59
Workaround to get Ardent's rule "unique" not fail when updating existing records.
<?php
namespace Mauro\Ardent;
class Ardent extends \LaravelBook\Ardent\Ardent {
public function validate( array $rules = array(), array $customMessages = array() ) {
if (empty($rules)) {
@mspivak
mspivak / .htaccess
Created November 29, 2012 00:13
Different robots.txt files for HTTP and HTTPS
RewriteEngine On
#This will have the file processed by robots.php instead of a regular static file.
RewriteRule ^robots.txt$ /robots.php [L]