Skip to content

Instantly share code, notes, and snippets.

@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:
@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 / default.vcl
Created May 14, 2012 17:17
Varnish config file w/ basic auth
backend default {
.host = "127.0.0.1";
.port = "8080";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
}
acl purge {
"localhost";
@benclark
benclark / gist:3059850
Created July 6, 2012 12:21
Switch Terminal settings of current window
on run argv
set mySettingName to item 1 of argv
tell application "Terminal"
set myWindow to front window
set myTab to selected tab of myWindow
try
set current settings of myTab to settings set mySettingName
end try
end tell
end run
@benclark
benclark / gist:3145218
Created July 19, 2012 16:47
Render the node teaser field in a row below the other fields in a table view
<?php
/**
* Implementation of theme_preprocess_views_view_table().
*/
function demcctheme_preprocess_views_view_table(&$vars) {
$view = &$vars['view'];
switch ($view->name) {
case 'og_topics':
if ($view->current_display == 'block_1') {
// Render the node teaser field in a row *below* the other fields.
@benclark
benclark / default.vcl
Created July 25, 2012 13:56
Varnish config file w/ mobile redirect
backend default {
.host = "127.0.0.1";
.port = "8080";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
}
acl purge {
"localhost";
@benclark
benclark / Preferences.sublime-settings
Created August 10, 2012 18:31
My Sublime Text 2 preferences
{
"auto_indent": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Default/IDLE.tmTheme",
"create_window_at_startup": false,
"default_line_ending": "unix",
"detect_indentation": false,
"ensure_newline_at_eof_on_save": true,
"fallback_encoding": "UTF-8",
"find_selected_text": true,
@benclark
benclark / my.cnf
Created August 21, 2012 14:30
MySQL config
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
@benclark
benclark / gist:3639991
Created September 5, 2012 17:01
Howto one-off install Ubercart zones for a country
drush php-eval "include_once('sites/all/modules/springboard/ubercart/uc_store/countries/japan_392_1.cif'); japan_install();"
@benclark
benclark / nodequeue_create.php
Created September 21, 2012 18:25 — forked from brockboland/nodequeue_create.php
Drupal: Create a nodequeue if it doesn't exist already
drupal_load('module', 'nodequeue');
// Homepage Features
$queue = nodequeue_load_queue_by_name('homepage_features');
if (empty($queue)) {
$queue = new stdClass();
$queue->title = 'Homepage Features';
$queue->name = 'homepage_features';
$queue->size = 4;
$queue->owner = 'nodequeue';