Skip to content

Instantly share code, notes, and snippets.

View felipegirotti's full-sized avatar
🏠
Working from home

Felipe Girotti felipegirotti

🏠
Working from home
View GitHub Profile
@felipegirotti
felipegirotti / default.conf
Last active June 5, 2019 19:44
Simple Nginx configuration for redux
upstream node {
server 127.0.0.1:8080;
keepalive 64;
}
server {
listen 80;
# server_name domain.com;
root /home/deploy/react;
@felipegirotti
felipegirotti / CommonRepository.php
Created May 29, 2019 15:45
Using repository exemple with Laravel
<?php
declare(strict_types=1);
namespace App\Repositories;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Support\Collection;
@felipegirotti
felipegirotti / README.md
Created May 23, 2019 12:15
Install Memcached MacOS - Homebrew PHP (7) Extension

Install Memcached in MacOS

First step install php

brew install php@7.3

You need install some dependencies before

brew install pkg-config libmemcached zlib
@felipegirotti
felipegirotti / mysql-config.yaml
Last active May 8, 2019 12:31
Mysql On Kubernetes
apiVersion: v1
kind: ConfigMap
metadata:
name: mysql
labels:
app: mysql
data:
my.cnf: |
[mysqld]
max_connections = 200
{
"keys": [
{
"kty": "RSA",
"n": "tnBgGUEakaYs309Y4GBeUmJaawCKgabndVseCe483reXGPfZMxlrotk3_jLwSiBtH0xf3gAWlaLxbfUpqmkZsvTnYxpKPcSiZWqVG1gihnhl65EGMViG5O4FXrENOkYcr-92cjsvPJWJh0OKW0MWOPH3vfOigXKKp1lB3cCGPbiWVv_bftEHEABzUFpa5Z3m-Gdb0mfsMbg4sb4bAG4vXvuOOEhLappqI5ArX7ACsCKK-HOYvduFKGNsvFQT8VqlQrqEiezCEPp2Napslg4Xl5_IOlRIjmxXWt_c2NM4USbQSDar3zQeO3iHGd7TBVGTsQIofVcapxLdAX9kmKCjnw",
"e": "AQAB",
"alg": "RS256",
"kid": "7c993a12-0da0-4d82-8d28-669a26599995",
"use": "sig"
}
@felipegirotti
felipegirotti / lista_update.json
Last active August 29, 2015 14:20
Webservice
# PARA ATUALIZAR A LISTA DEPOIS DE TERMINADO O DOWNLOAD DO ARQUIVO,
# DESTA MANEIRA NÃO ENVIA MAIS O ARQUIVO NA LISTA PARA DOWNLOAD
# ENDPOINT: site/api/v1/list/{idItem}?token={token}
# MÉTODO HTTP: PUT
{
"updated" : true
}
<?php
class OperacoesController extends Zend_Controller_Action
{
public function init()
{
if(!Zend_Auth::getInstance()->hasIdentity()){
$this->_redirect('autenticacao');
}
}
@felipegirotti
felipegirotti / DbInterface.php
Created April 11, 2013 22:56
Implementação de interface em PHP. Programar por interface, é ter a garantia de que aquela classe tem o método que eu quero. A identidade da classe, a assinatura do método.
<?php
interface DbInterface
{
public function getConnect();
}