Skip to content

Instantly share code, notes, and snippets.

View vinyvicente's full-sized avatar
🎯
Focusing

Vinicius vinyvicente

🎯
Focusing
View GitHub Profile
@jscherer26
jscherer26 / Acl.php
Created December 17, 2009 18:00
Zend Navigation & Acl
<?php
class Model_Acl extends Zend_Acl {
public function __construct() {
// define Roles
$this->addRole(new Zend_Acl_Role('guest')); // not authenicated
$this->addRole(new Zend_Acl_Role('member'), 'guest'); // authenticated as member inherit guest privilages
$this->addRole(new Zend_Acl_Role('admin'), 'member'); // authenticated as admin inherit member privilages
@diegoprates
diegoprates / gist:5047663
Last active June 19, 2023 21:26
Tradução do jQuery validation plugin para pt-BR.
/*
* Translated default messages for the jQuery validation plugin.
* Locale: PT_BR
*/
jQuery.extend(jQuery.validator.messages, {
required: "Este campo &eacute; requerido.",
remote: "Por favor, corrija este campo.",
email: "Por favor, forne&ccedil;a um endere&ccedil;o eletr&ocirc;nico v&aacute;lido.",
url: "Por favor, forne&ccedil;a uma URL v&aacute;lida.",
date: "Por favor, forne&ccedil;a uma data v&aacute;lida.",
@danielcosta
danielcosta / integrating_jira_with_sourcetree.md
Last active November 7, 2023 21:03
Learn how to integrate your SourceTree repositories with JIRA

Integrating JIRA with SourceTree

Overview

You will learn how to link your JIRA tasks directly on SourceTree

Step by step

1. Setting

@denji
denji / nginx-tuning.md
Last active July 7, 2024 04:40
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@kwisatz
kwisatz / ApiKeyAuthenticationServiceProvider.php
Last active February 10, 2018 13:25
Silex ApiKeyAuthenticationServiceProvider
<?php
/**
* ApiKeyAuthenticator for the Symfony Security Component
*/
namespace Ttf\Security\Provider;
use Silex\Application,
Silex\ServiceProviderInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException,
Symfony\Component\Security\Core\Authentication\Provider\SimpleAuthenticationProvider,
@xocasdashdash
xocasdashdash / infinite-scroll.js
Created August 24, 2014 13:42
Simple infinite scrol with jQuery and a Symfony2 backend
is_processing = false;
last_page = false;
function addMoreElements() {
is_processing = true;
$.ajax({
type: "GET",
//FOS Routing
url: Routing.generate('route_name', {page: page}),
success: function(data) {
if (data.html.length > 0) {
<?php
namespace App\Listeners;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
@nurrony
nurrony / compile-nginx-from-source.sh
Last active September 27, 2019 11:00
All configuration files needed to install nginx on Ubuntu 16.04 Compile Nginx from source with nginx-rtmp-module, pagespeed and cache-purge module.
#change it to latest version
NPS_VERSION=1.11.33.0;
echo "Changing Directory to $HOME..."
cd $HOME;
echo "Nginx version to install: " && \
read NGINX_VERSION && \
echo "Downloading nginx-$NGINX_VERSION..." && \
wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz && \
echo "Installing Nginx Dependencies..." && \
@eminetto
eminetto / VagaBackendCoderockr.md
Last active May 15, 2017 17:27
Vaga desenvolvedor Backend Coderockr

Requisitos

  • Conhecimentos avançados em Orientação a Objetos
  • Conhecimentos avançados em linguagens de programação para backend como PHP, Python, Go
  • Conhecimentos em algum framework como Zend Framework, Zend Expressive, Silex, Django, Symfony ou similares
  • Conhecimentos em ORMs como Doctrine 2 (entidades, relacionamentos, consultas)
  • Conhecimentos avançados em testes unitários
  • Conhecimentos em banco de dados como MySQL e PostgreSQL
  • Conhecimentos em Git (branches, Pull Requests)
  • Inglês técnico, pelo menos para leitura
http://www.oreilly.com/data/free/files/2014-data-science-salary-survey.pdf
http://www.oreilly.com/data/free/files/2015-data-science-salary-survey.pdf
http://www.oreilly.com/data/free/files/Data_Analytics_in_Sports.pdf
http://www.oreilly.com/data/free/files/advancing-procurement-analytics.pdf
http://www.oreilly.com/data/free/files/ai-and-medicine.pdf
http://www.oreilly.com/data/free/files/analyzing-data-in-the-internet-of-things.pdf
http://www.oreilly.com/data/free/files/analyzing-the-analyzers.pdf
http://www.oreilly.com/data/free/files/architecting-data-lakes.pdf
http://www.oreilly.com/data/free/files/being-a-data-skeptic.pdf
http://www.oreilly.com/data/free/files/big-data-analytics-emerging-architecture.pdf