Skip to content

Instantly share code, notes, and snippets.

View filhodanuvem's full-sized avatar
👋

Claudson Oliveira filhodanuvem

👋
View GitHub Profile
@xanf
xanf / AjaxAuthenticationListener.php
Created June 8, 2011 19:20
AJAX auth errors listener for Symfony2
<?php
namespace Application\ProdrepHelperBundle\Component\Event;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
/**
*/
class AjaxAuthenticationListener
@slok
slok / create_github_bitbucket_mirror.md
Created December 8, 2011 11:30
Create github and bitbucket mirror in gitolite

Create Github/Bitbucket Mirror

Create SSH key and configure

Create Key (no passphrase and name mirror the key)

ssh-keygen -t rsa -N "" -f ~/.ssh/mirror
@alganet
alganet / roadmap.md
Last active October 3, 2015 07:37
Respect Project Roadmap

Respect Project Roadmap

Respect is a small set of independent libraries. We do not plan to release a full stack framework, but we do have a roadmap for new components. Many of them may fit in other organizations outside Respect and many of them may include contributions to other projects.

The main goal is to provide a standards-based platform and ecosystem for Semantic Web development based on common PHP technology.

About Semantic Web

@filhodanuvem
filhodanuvem / composer.json
Created July 3, 2012 00:15
FaceApp scaffold
{
"name" : "NomeDoProjeto",
"autoload" : {
"psr-0" : { "NomeDoProjeto" : "src/"}
},
"minimum-stability": "dev" ,
"license" : "MIT",
"authors": [
{
"name": "Claudson Oliveira",
@filhodanuvem
filhodanuvem / cool_url.php
Created December 26, 2012 16:23
And if cURL was more easy on PHP ?
<?php
//maybe, do a source that works like a client with cURL could be hard and boring.
// A fluent interface would awesome.
// Anyway, the library can be used only to fun and study to learn how HTTP works in lower lever.
use Saturno\CoolUrl\Client as cu;
cu::create()->target("http://example.com/join")
->setMethod('POST')
@nikic
nikic / objects_arrays.md
Last active April 12, 2024 17:05
Post explaining why objects often use less memory than arrays (in PHP)

Why objects (usually) use less memory than arrays in PHP

This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)

The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array part of it away. So how does that work?

The key here is that objects usually have a predefined set of keys, whereas arrays don't:

@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@hgfischer
hgfischer / benchmark+go+nginx.md
Last active April 11, 2024 22:09
Benchmarking Nginx with Go

Benchmarking Nginx with Go

There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.

So, these are the different settings we are going to compare:

  • Go HTTP standalone (as the control group)
  • Nginx proxy to Go HTTP
  • Nginx fastcgi to Go TCP FastCGI
  • Nginx fastcgi to Go Unix Socket FastCGI
@augustohp
augustohp / vim-para-usuarios-git.md
Last active March 20, 2024 20:09
Post: VIM para usuários Git

VIM para usuários Git

A intenção desse post é melhorar, se possível, seu workflow com o [Git][] se ele atualmente ele consiste de:

  1. Usar o [Git][] através de uma shell de sua escolha.
  2. Usar o [VIM][] como [editor padrão][2] [no Git][1].

Se você usa alguma ferramenta gráfica (tig também conta), eu não quero saber. Se você usa o [Git][] numa shell em conjunto com outro editor, procuro ansiosamente seu comentário me convencendo a trocar. :)

Preparando o VIm

@markomafs
markomafs / ProgressBar.php
Last active August 29, 2015 13:59
Trait to Implement Progress Bar for CLI's
<?php
/**
* Progress Bar Trait
* @package Core\Traits
* @author Marco Souza<marco.souza@tricae.com.br>
*/
namespace Core\Traits;