Skip to content

Instantly share code, notes, and snippets.



  • Digital Echidna
  • Canada
View GitHub Profile
Cottser /
Created Mar 28, 2014
Make mkdir always use mkdir -p
alias mkdir='mkdir -p'
Cottser / dispatch-postbox.scpt
Created Apr 3, 2014
AppleScript application to open x-dispatch:// links in Postbox on OS X
View dispatch-postbox.scpt
on open location messageUri
Extract message ID from the message:// URI. Where [MESSAGEID] is the message ID,
the Dispatch OS X URL Helper sets up URLs for in the following format:
set messageId to text 14 thru -4 of messageUri
do shell script "open x-postbox-message://" & messageId
end open location
Cottser / services.yml
Last active Aug 29, 2015
Disable cache_render or other cache bins in Drupal 8
View services.yml
class: Drupal\Core\Cache\MemoryBackendFactory
Cottser / bootstrap.local.php
Created Oct 8, 2010
Local bootstrap file for debugging. Place at config/bootstrap.local.php
View bootstrap.local.php
Configure::write('debug', 2);
Cottser / quix.txt
Created Sep 17, 2011
Quix config file
View quix.txt
> This is a Quix Command File
> For the syntax of this file, please refer to
@Duck Duck Go replacements
Cottser / block.tpl.php
Created Sep 23, 2011
HTML5 block-level links for Drupal 7 blocks
View block.tpl.php
<?php // Replace this: ?>
<?php print $content; ?>
<?php // With this: ?>
<?php if (isset($block->title_link)): ?>
<?php print l($content, $block->title_link, array('attributes' => array('title' => $block->title_link_title), 'html' => TRUE)); ?>
<?php else: ?>
<?php print $content; ?>
Cottser / module.module
Created Sep 26, 2011
Band-aid fixes for conflict between Block Title Link and Menu Block modules (D7)
View module.module
// Mini module to remove Block Title Link options from Menu Block blocks
function MODULE_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'block_admin_configure') {
$module = $form['module']['#value'];
if ($module == 'menu_block') {
// remove fieldset
Cottser /
Created Sep 3, 2013
Drupal 8 bash functions
# Clean up Drupal 8 installation and do a pull.
function cleand8() {
chmod u+w sites/default
git reset --hard
git checkout 8.x
git pull
sudo rm -rf sites/default/files/php
drush cc all
Cottser /
Last active Dec 23, 2015
Bash aliases for testing and applying patches based on the URL on your clipboard. If you're on OS X, grab the first three lines and add to your ~/.bash_profile. If you're on Linux, grab lines 5-8 and add to your ~/.bash_profile or ~/.bashrc or whatnot :)Testbot uses git to apply patches, I only include the `patch` version here because sometimes …
# These ones are for OS X.
alias cav='curl `pbpaste` | git apply -v --check'
alias capv='curl `pbpaste` | patch -p1 --dry-run'
# These are untested but should work on many flavours of Linux. If they don't,
# please leave a comment!
alias cav='curl `xsel --clipboard --output` | git apply -v --check'
alias capv='curl `xsel --clipboard --output` | patch -p1 --dry-run'
# Patch shortcuts (some duplication of the above, but covers more use cases).
Cottser /
Last active Feb 7, 2016
xhprof-kit aliases and functions
# Creates a baseline from your current branch (should usually be 8.x).
alias bbranch='./xhprof-kit/ `git rev-parse --abbrev-ref HEAD`'
# Using the baseline xhprof identifier from the bbranch command above will benchmark 8.x against the baseline and your patched branch.
# e.g.
# bbranches [XHPROF-IDENTIFIER] [twig-branch-name-here-1234456]
function bbranches() {
originalbranch="$(git rev-parse --abbrev-ref HEAD)"
You can’t perform that action at this time.