Skip to content

Instantly share code, notes, and snippets.

View jjcodes78's full-sized avatar
🎯
Focusing

Jorge Gonçalves Junior jjcodes78

🎯
Focusing
View GitHub Profile
server {
listen 80;
server_name CHANGEME.app;
root /var/www/vhosts/CHANGEME.app/public;
index index.html index.htm index.php;
charset utf-8;
location / {
sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text
@jjcodes78
jjcodes78 / laravel.cmd
Created February 21, 2016 08:47
Batch script para instalação do Laravel Framework via prompt no Windows
@echo off
echo Laravel Installer
if "%1" == "init" goto init
if "%1" == "new" goto new
echo Uso:
echo laravel init [versao] - instala uma nova aplicacao na pasta atual (precisa estar vazia a pasta!)
echo laravel new [nome] [versao] - instala uma nova aplicacao na pasta 'nome'. Se nome nao for indicado ele criara na pasta 'laravel' por padrao.
@echo off
php artisan %*
@echo off
set APACHE_DIR=C:\Development\xampp\apache
set MYSQL_DIR=C:\Development\xampp\mysql
if "%~1" == "stop" goto stop
goto start
if errorlevel 1 goto error
goto finish
@jjcodes78
jjcodes78 / RestController.php
Last active June 23, 2016 02:26
RestController Abstract Class for Laravel Eloquent
<?php
/**
* Created by PhpStorm.
* User: squad
* Date: 22/06/16
* Time: 14:33
*/
namespace App\Http\Api;
@jjcodes78
jjcodes78 / ClienteController.php
Created June 22, 2016 22:17
Controller using RestfulApi abstract Class on Laravel 5.1
<?php
namespace App\Http\Controllers;
use App\Cliente;
use App\Http\Api\RestfulApi;
use App\Http\Requests\ClientRequest;
class ClienteController extends RestfulApi
{
@jjcodes78
jjcodes78 / .htaccess
Created July 7, 2016 01:15
Arquivo .htaccess para hospedagem compartilhada (Laravel)
RewriteEngine On
RewriteBase /
# Rewrite to pulic
RewriteCond %{HTTP_HOST} ^example.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^example.com$
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) /public/$1 [L]
# Redirect www to domain
// Classe Java para Oracle;
public class Fonetica {
public static fonetizar (String str) : String {
//Fonetiza o string recebido como parametro e devolve
//um outro string (que e o primeiro fonetizado)
str = str_upper(str); //todas as letras maiusculas
str = removePrep(str); //remove as preposições
str = removeAccentuation(str); //remove os acentos
str = removeStrange(str); //remove caracteres diferentes de