Skip to content

Instantly share code, notes, and snippets.

@timplunkett
timplunkett / gist:867699
Created March 12, 2011 23:33
Interpolation and foreach
// Sass
$selectors: {foo, bar, baz};
foreach $selectors as $selector {
.#{$selector} { background-image: url("../images/#{$selector}/background.png"); }
}
// CSS
.foo {
background-image: url("../images/foo/background.png");
}
@timplunkett
timplunkett / gist:1894660
Created February 23, 2012 19:43
PHP 5.3 object passing
<?php
function pass_by_pointer($obj = NULL) {
$obj->value = 5;
}
function pass_by_reference(&$obj = NULL) {
$obj->value = 4;
}
function drupal-install() {
# Remove existing database
drush sql-drop -y;
# Remove existing install
sudo rm -rf sites/default;
# Restore the sites/default/default.settings.php file
sudo git checkout -- sites/default;
# Temporarily make the sites/default writable by anyone
sudo chmod -R 777 sites/default;
# Ensure the owner is the current user, not root user
<?php
/**
* Constructs a new context definition object.
*
* @param array $values
* An associative array with the following keys:
* - value: The required data type.
* - required: (optional) Whether the context definition is required.
* - multiple: (optional) Whether the context definition is multivalue.
@timplunkett
timplunkett / setupd8
Last active January 7, 2019 21:02
Reinstall D8
#!/bin/bash
PROFILE="standard"
DB="d8"
UI=false
NO_DEV=false
OPTS=`getopt -o h --longoptions db:,profile:,ui,no-dev -- "$@"`
eval set -- "$OPTS"
while true; do
@timplunkett
timplunkett / gist:2c6242539ad59066ae0e
Last active November 6, 2015 21:08
Post-rock and related
1 Mile North
12Twelve
65Daysofstatic
A Genuine Freakshow
A Northern Chorus
Album Leaf, The
All Shall Be Well (and All Shall Be Well and All Manner of Things Shall Be Well)
Amiina
And So I Watch You from Afar
Antarctica
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage: git idiff [comment-number] [interdiff-rev] [base-rev]"
exit 1
fi
COMMIT=${2:-"HEAD^"}
BASE_BRANCH=${3:-"8.6.x"}
REMOTE=${4:-"origin"}

Keybase proof

I hereby claim:

  • I am timplunkett on github.
  • I am timplunkett (https://keybase.io/timplunkett) on keybase.
  • I have a public key ASCxqqMQoh2_LZdNlgv57XLfu6fHDYsNdm70CLjhjYFCUgo

To claim this, I am signing this object:

#!/bin/bash
rm -rf vendor/
xdebug-toggle off
composer install
composer run-script drupal-phpunit-upgrade
composer require zaporylie/composer-drupal-optimizations:^1.0
composer require drush/drush
git checkout -- composer.*
#!/bin/bash
rm -rf vendor/
xdebug-toggle off
composer install
composer run-script drupal-phpunit-upgrade
composer require zaporylie/composer-drupal-optimizations:^1.0
composer require drush/drush