Skip to content

Instantly share code, notes, and snippets.

View albertofem's full-sized avatar

Alberto albertofem

View GitHub Profile

Keybase proof

I hereby claim:

  • I am albertofem on github.
  • I am albertofem (https://keybase.io/albertofem) on keybase.
  • I have a public key ASD6XSwOiJyzCUNHJ62tPneAkxM1VZU4GAeGfR_lZvsNpwo

To claim this, I am signing this object:

@albertofem
albertofem / redis-copy-network.sh
Created February 6, 2015 11:49
redis-copy-network
#!/bin/bash
source_host=localhost
source_port=6379
source_db=0
target_host=localhost
target_port=23123
target_db=0
@albertofem
albertofem / redmine_config.conf
Last active August 29, 2015 14:10
Redmine VirtualHost configuration
# Apache 2.2 mod_header
Header always unset "X-Powered-By"
Header always unset "X-Rack-Cache"
Header always unset "X-Content-Digest"
Header always unset "X-Runtime"
PassengerMaxPoolSize 20
PassengerMaxInstancesPerApp 4
PassengerPoolIdleTime 3600
PassengerUseGlobalQueue on
@albertofem
albertofem / reflection-benchmark.php
Last active August 29, 2015 14:07
Reflection benchmark
<?php
define('NUM_TESTS', 10);
class Model
{
private $property;
public function getProperty()
{
@albertofem
albertofem / bogosort.php
Last active August 29, 2015 14:01
Bogo sort
<?php
// usage: php bogosort.php 1,2,3,4,5
$items = explode(",", $argv[1]);
shuffle($items);
$shuffled = 0;
$ordered = bogoSort($items);
@albertofem
albertofem / default.vcl
Last active August 29, 2015 13:59
Symfony, Varnish, HTTP cache
backend default
{
.host = "127.0.0.1";
.port = "8080";
}
sub vcl_recv
{
if(req.http.X-Force-Backend)
{
curl -i https://api.github.com/users/albertofem/repos
HTTP/1.1 200 OK
Server: GitHub.com
Date: Mon, 31 Mar 2014 10:36:34 GMT
Content-Type: application/json; charset=utf-8
Status: 200 OK
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 56
X-RateLimit-Reset: 1396265742
@albertofem
albertofem / gist:3035119
Created July 2, 2012 19:24
Complexity Algorithm
<?php
$test = array(
"1",
"2",
"3",
"4",
"5",
"6",
"7",