Skip to content

Instantly share code, notes, and snippets.

View diegofelix's full-sized avatar

Diego Felix diegofelix

View GitHub Profile
@diegofelix
diegofelix / Free O'Reilly Books.md
Created August 9, 2019 16:29 — forked from augbog/Free O'Reilly Books.md
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@diegofelix
diegofelix / gist:8538432
Last active January 3, 2016 23:59 — forked from daylerees/gist:8537274
Laravel 4: Base Validator

My Validation Base Class

I was asked how I deal with validation / create and update validation rulesets. Well here is one method I have used. Don't be afraid to build on top of what the framework has already given you. In my projects I use a base class for almost anything. You never know when you want your classes to inherit some common functionality. My BaseValidator actually has some pretty useful methods and properties in it.

<?php

namespace FooProject\Internal\Validators;

use FooProject\Internal\Sanitizers\BaseSanitizer;
@diegofelix
diegofelix / routes.php
Created January 9, 2014 10:12 — forked from fhferreira/routes.php
Laravel 4: Custom Paginator
<?php
View::composer(Paginator::getViewName(), function($view) {
$query = array_except( Input::query(), Paginator::getPageName() );
$view->paginator->appends($query);
});
@diegofelix
diegofelix / filters.php
Created November 18, 2013 12:32 — forked from zmsaunders/filters.php
Laravel 4: Minifying Html Response
<?php
### --- Snip --- ###
App::after(function($request, $response)
{
// HTML Minification
if(App::Environment() != 'local')
{
if($response instanceof Illuminate\Http\Response)
@diegofelix
diegofelix / laravel-weekly-23-quick-tip.php
Created September 17, 2013 15:42 — forked from driesvints/laravel-weekly-23-quick-tip.php
Laravel 4: Form range examples
<?php
# Create a list with numbers ranging from 10 to 20.
Form::selectRange('number', 10, 20);
# Create a list with years ranging from 1900 to 2000.
Form::selectYear('year', 1900, 2000);
# Creates a list with month names.
Form::selectMonth('month');
@diegofelix
diegofelix / SublimeText3_ContextMenuReg
Last active December 20, 2015 04:29 — forked from iaian/sublimeText2_contextMenu.reg
Sublime Text 3: Adding Context Menu on Windows
Windows Registry Editor Version 5.00
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\shell\sublime]
@="Open Folder as Sublime Project"
"Icon"="\"C:\\Program Files\\Sublime Text 3\\sublime_text.exe\",0"
[HKEY_CLASSES_ROOT\Directory\shell\sublime\command]
@diegofelix
diegofelix / gist:5404428
Last active December 16, 2015 08:18 — forked from rjv/gist:5372014
Laravel 4: Installing via Composer
composer create-project laravel/laravel --prefer-dist
@diegofelix
diegofelix / .htaccess
Created April 17, 2013 13:42
Laravel 3: .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
@diegofelix
diegofelix / index.html
Last active October 10, 2015 21:58 — forked from kennethsnippet/gist:3757593
HTML: HTML5 Template
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<title>untitled</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css">
<!-- Main -->