Skip to content

Instantly share code, notes, and snippets.

View pfaocle's full-sized avatar

Paul Byrne pfaocle

View GitHub Profile
@philwolstenholme
philwolstenholme / ######-phil-wolstenholme-drupalcon-europe-2020-utility-first-css.md
Last active November 1, 2021 09:18
Phil Wolstenholme - DrupalCon Europe 2020 - Utility-first CSS

Hello DrupalCon! 👋

Here's a big dump of code examples from my slides, plus some examples that didn't make it to the final cut.

The snippets should be organised by slide number, e.g. #46--_search.scss is the snippet of search-related SCSS shown on slide 46.

My slides

Here's a PDF of my slides (via Google Drive) for your reference, or if Zoom goes wrong!

@sindresorhus
sindresorhus / post-merge
Last active July 25, 2024 06:53
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@pfaocle
pfaocle / exiftool-fiddle.sh
Last active December 21, 2015 03:19
Use exiftool to fiddle the dates on photos (when I forget to set the date/time correctly on my camera).
#!/bin/sh
FILE_FORMAT="JPG"
# Show dates of all JPG files in current directory, in human readable format.
exiftool -d '%r %a, %B %e, %Y' -DateTimeOriginal -S -s -ext $FILE_FORMAT .
# Fiddle the dates - some date fields forward.
# Format is Y:M:D h:m:s
exiftool -F -AllDates+="2:6:0 0" *$FILE_FORMAT
@jgraham909
jgraham909 / image_link_update.php
Created March 6, 2013 21:43
Update content after Drupal 7.20 update to account for image cache tokens
@stewsnooze
stewsnooze / gist:1451329
Created December 9, 2011 12:21
Detecting errors in drush in Jenkins
YOURDRUSHCOMMAND 2>&1 |tee /tmp/test$BUILD_ID
if [ `grep -e "Fatal error" /tmp/test$BUILD_ID | wc -l` != 0 ]; then
ERROR_LEVEL=1
fi
.....
if [ `grep -e "^.* passes," /tmp/test$BUILD_ID | grep -v "0 fails" | wc -l` == 0 ]; then
echo "exited $ERROR_LEVEL" > /tmp/exit_code
exit $ERROR_LEVEL
else
exit 1
@rfay
rfay / .gitconfig
Created April 12, 2011 04:12 — forked from schacon/.gitconfig
insteadOf Example for git.drupal.org
# Put this in your .gitconfig
[url "http://git.drupal.org/project/"]
insteadOf = "do:"