Skip to content

Instantly share code, notes, and snippets.

View AaronRutley's full-sized avatar

Aaron Rutley AaronRutley

  • Melbourne, Australia
View GitHub Profile
@AaronRutley
AaronRutley / gist:b83a811188d988f33b38
Created March 18, 2015 15:51
Slick Responsive Photo Gallery with Sass - Example Sass
.gallery-7-up {
.image-1-of-7 {
@include gallery_grid($whole,$third,$third);
}
.image-2-of-7, .image-3-of-7 {
@include gallery_grid($half,$third,$third);
}
.image-4-of-7, .image-5-of-7, .image-6-of-7, .image-7-of-7 {
@include gallery_grid($half,$quater,$quater);
}
<div class="image-gallery-container gallery-7-up">
<div class="image image-1-of-7"><!-- image here --></div>
<div class="image image-2-of-7"><!-- image here --></div>
<div class="image image-3-of-7"><!-- image here --></div>
<div class="image image-4-of-7"><!-- image here --></div>
<div class="image image-5-of-7"><!-- image here --></div>
<div class="image image-6-of-7"><!-- image here --></div>
<div class="image image-7-of-7"><!-- image here --></div>
</div>
@AaronRutley
AaronRutley / gist:2827108abf7e86c146a9
Last active August 29, 2015 14:19
imac target display mode alias
# imac target display mode function
alias imac='function _imac(){
if [ $1 = "start" ]; then
echo "--- MacBook Bluetooth on...";
blueutil on;
sleep 1;
echo "--- Connecting to iMac via ssh...";
ssh -2 -p 22 aaronrutley@aaronimac.local sh ~/tdm/start.sh;
fi
@AaronRutley
AaronRutley / end.sh
Last active October 19, 2015 19:59
end.sh
# end.sh
blueutil on
echo "--- iMac Bluetooth on..."
sleep 5
echo "--- Target Display Mode command..."
osascript -e 'tell application "System Events" to key code 144 using command down'
echo "--- Target Display Mode Ended......."
exit
@AaronRutley
AaronRutley / start.sh
Last active August 29, 2015 14:19
start.sh
# start.sh
osascript -e 'tell application "System Events" to key code 144 using command down'
echo "--- Target Display Mode Started......."
blueutil off
echo "--- iMac Bluetooth off..."
exit
@AaronRutley
AaronRutley / shutdown.sh
Last active August 29, 2015 14:19
shutdown.sh
# shutdown.sh
echo "--- Remote iMac Shutting Down......";
osascript -e 'tell application "Finder" to shut down';
#chassis
alias chassis='function _chassis(){
if [ $1 = "create" ]; then
cd ~/Vagrant-local;
git clone --recursive https://github.com/Chassis/Chassis $2;
rm -rf .git;
cd $2;
git clone https://aaronrutley@bitbucket.org/aaronrutley/turbo.git content;
cd content;

New computer setup

  • a/o 2015-05-27 *

Format the drive

  1. Restart with cmd-R or cmd-D
  2. Erase drive / 3x if second-handk
  3. Reinstall MacOS
# WP, ACF and PHP snippets
'.text.html.php:not(.source)':
'ACF Field':
'prefix': 'acf'
'body': '''
<?php the_field( '${1:field_name}' ); ?>
'''
'ACF Image':
@AaronRutley
AaronRutley / post_to_slack.php
Last active March 11, 2020 00:07
post_to_slack.php
<?php
/**
* Post a message to Slack from WordPress
*
* @param string $message the message to be sent to Slack
* @param string $channel the #channel to send the message to (or @user for a DM)
* @param string $username the username for this bot eg : WordPress bot
* @param string $icon_emoji the icon emoji name for this bot eg :monkey:
*