Skip to content

Instantly share code, notes, and snippets.

@benclark
benclark / default.vcl
Last active October 1, 2015 07:07
Varnish config file
backend default {
.host = "127.0.0.1";
.port = "80";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
}
acl purge {
"localhost";
@benclark
benclark / local.settings.php
Last active September 29, 2015 20:48 — forked from brockboland/local.settings.php
My local settings for Drupal sites
<?php
/**
* @file
* local.settings.php (Drupal 6.x)
*
* This settings file is intended to contain settings specific to a local
* development environment, by overriding options set in settings.php.
*
* Include this file from your regular settings.php by including this at the
* bottom:
@chrisjlee
chrisjlee / settings-router.php
Last active September 27, 2015 07:47
Drupal Settings file router - localhost / etc
/*
* At the end of the settings.php file for drupal add these lines
*/
/*
* Settings file routing
*/
if (file_exists(dirname(__FILE__) . '/local.settings.php')) {
include dirname(__FILE__) . '/local.settings.php';
}
@avargas
avargas / gist:1004594
Created June 2, 2011 14:54
PHP Memcached failover
<?php
$mem = new Memcached("pool");
$mem->setOption(Memcached::OPT_BINARY_PROTOCOL, true);
$mem->setOption(Memcached::OPT_DISTRIBUTION, Memcached::DISTRIBUTION_CONSISTENT);
$mem->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
$mem->setOption(Memcached::OPT_NO_BLOCK, true);
$mem->setOption(Memcached::OPT_SERVER_FAILURE_LIMIT, 1);
$mem->setOption(Memcached::OPT_RETRY_TIMEOUT, 30);
$mem->setOption(29, 2);
@BinaryMuse
BinaryMuse / gist_tag.rb
Created January 31, 2011 00:44
A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers.
require 'cgi'
require 'digest/md5'
require 'net/https'
require 'uri'
module Jekyll
class GistTag < Liquid::Tag
def initialize(tag_name, text, token)
super
@text = text