Skip to content

Instantly share code, notes, and snippets.

Thijs Feryn ThijsFeryn

Block or report user

Report or block ThijsFeryn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ThijsFeryn
ThijsFeryn / gist:3034031
Created Jul 2, 2012
Save syntax highlighted PHP source code into an HTML file
View gist:3034031
$ php -s test.phps > test.html
$
@ThijsFeryn
ThijsFeryn / gist:3034094
Created Jul 2, 2012
Using highlight_file to perform syntax highlighting in PHP
View gist:3034094
<?php
//Echo directly
highlight_file('test.php');
//Store in variable first
$source = highlight_file('test.php', true);
echo $source;
@ThijsFeryn
ThijsFeryn / gist:3034109
Created Jul 2, 2012
Using highlight_string to perform syntax highlighting in PHP
View gist:3034109
<?php
highlight_string('<?php echo "A line of PHP code a day keeps the doctor away";');
@ThijsFeryn
ThijsFeryn / gist:3737009
Created Sep 17, 2012
Composer file for Silex & Zend Framework
View gist:3737009
{
"minimum-stability": "dev",
"require": {
"silex/silex": "1.0.*",
"zendframework/zendframework": "2.0.*"
}
}
@ThijsFeryn
ThijsFeryn / wordpress.vcl
Created Oct 10, 2012 — forked from willmot/wordpress.vcl
WordPress Varnish VCL
View wordpress.vcl
backend default {
.host = "127.0.0.1";
.port = "8080";
}
acl purge {
"localhost",
"69.195.222.132"
}
sub vcl_recv {
View symfony http & twig
{
"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 Jun 15, 2015
Pass the JoindIn speaker id to this program and it will count the amount of talks given at each location
View joindin_location_count.go
package main
import (
"strconv"
"io/ioutil"
"log"
"net/http"
"fmt"
"encoding/json"
"time"
@ThijsFeryn
ThijsFeryn / gist:b6ae0b6f7ea9b3eda9a1
Created Jul 14, 2015
Deflate for old & new versions of Apache
View gist:b6ae0b6f7ea9b3eda9a1
<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 / varnishusage.go
Last active Jun 7, 2019
A Go script that retrieves the Varnish memory consumption and returns it via a RESTful API using GoJi
View varnishusage.go
package main
import (
"strconv"
"net/http"
"github.com/zenazn/goji"
"github.com/zenazn/goji/web"
"os/exec"
"encoding/json"
)
@ThijsFeryn
ThijsFeryn / varnishv4esi.vcl
Last active Nov 12, 2015
VCL snippet that contains the minimum amount of config to support ESI using Surrogate headers
View varnishv4esi.vcl
vcl 4.0;
backend default {
.host = "127.0.0.1";
.port = "8080";
}
sub vcl_recv {
set req.http.Surrogate-Capability = "key=ESI/1.0";
}
You can’t perform that action at this time.