Skip to content

Instantly share code, notes, and snippets.

for alias in `drush sa`; do echo $alias; drush @$alias updb -y; done
@benclark
benclark / gist:2dd1ad7f5092e4846fb9
Created October 29, 2014 19:49
Create random password for every Drupal user from uid 1 to uid 45
#
# Create random password for every Drupal user from uid 1 to uid 45
# @todo - variable user ID sequence?
#
for uid in $(seq 45); do uname=$(drush user-information $uid 2>/dev/null | grep -oP "(?<=User name \: ).+"); if [ -n "${uname}" ]; then drush user-password "$uname" --password=$(date | md5sum); fi done
program WAR;
uses crt,DispANS,TextCursor;
const
top = 1;
whichCards : array[2..14] of char =
('2','3','4','5','6','7','8','9','0','J','Q','K','A');
type setCards = array[2..14] of integer;
@benclark
benclark / gist:70a802c015ce74d610e3
Created June 9, 2015 19:34
Run drush updb in parallel in groups of 5
#!/bin/sh
#
# Run `drush updb` in parallel in groups of 5.
#
# The for loop is populated by running `drush sa`, but this could also be a
# file with aliases on each line.
#
# The
i=0
@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 / 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 / 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 / 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();"