Skip to content

Instantly share code, notes, and snippets.

View ThijsFeryn's full-sized avatar

Thijs Feryn ThijsFeryn

View GitHub Profile
{
"require": {
"symfony/http-foundation": "2.5.3",
"symfony/http-kernel": "2.5.3",
"twig/twig": "1.16.0"
}
}
@ThijsFeryn
ThijsFeryn / joindin_location_count.go
Created June 15, 2015 08:48
Pass the JoindIn speaker id to this program and it will count the amount of talks given at each location
package main
import (
"strconv"
"io/ioutil"
"log"
"net/http"
"fmt"
"encoding/json"
"time"
@ThijsFeryn
ThijsFeryn / gist:b6ae0b6f7ea9b3eda9a1
Created July 14, 2015 14:10
Deflate for old & new versions of Apache
<IfModule filter_module>
<IfVersion >= 2.4>
FilterDeclare COMPRESS
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} =~ m|^text/html|"
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} =~ m|^text/html|"
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} =~ m|^text/css|"
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} =~ m|^text/plain|"
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} =~ m|^text/xml|"
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} =~ m|^text/x-component|"
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} =~ m|^application/javascript|"
@ThijsFeryn
ThijsFeryn / Magento APC cache
Created June 22, 2012 11:37
Configuring Magento APC cache backend in local.xml
<global>
...
<cache>
<backend>apc</backend>
<prefix>MAGE_</prefix>
</cache>
...
</global>
@ThijsFeryn
ThijsFeryn / Magento Memcached cache
Created June 22, 2012 11:49
Configuring Magento Memcached cache backend in local.xml
<global>
...
<cache>
<backend>memcached</backend>
<memcached>
<servers>
<server>
<host><![CDATA[127.0.0.1]]></host>
<port><![CDATA[11211]]></port>
<persistent><![CDATA[1]]></persistent>
apc.max_file_size = 10M
apc.shm_size = 128M
@ThijsFeryn
ThijsFeryn / Command line PHP example
Created June 26, 2012 07:48
Command line PHP example
$ php test.php
@ThijsFeryn
ThijsFeryn / PHP command line arguments
Created June 26, 2012 08:04
Working with arguments in PHP on the command line
$ php cli.php arg1 arg2
@ThijsFeryn
ThijsFeryn / gist:2994304
Created June 26, 2012 08:09
Working with arguments in PHP on the command line
<?php
echo "There are {$argc} passed: ".PHP_EOL;
foreach($argv as $k=>$v){
echo "Argument {$k}: {$v}".PHP_EOL;
}
@ThijsFeryn
ThijsFeryn / gist:2994370
Created June 26, 2012 08:25
Working with I/O streams in PHP
$ php test.php < test.txt