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 / ar_user_login.php
Last active October 3, 2015 22:45
ar_user_login.php
<?php
// ar_user_login : on WordPress login, post a message to slack
function ar_user_login($user_login) {
// get the user info
$user = get_user_by('login',$user_login);
// get the user ID
$user_id = $user->ID;
@AaronRutley
AaronRutley / atom-styles.css
Last active April 26, 2016 05:32
atom-styles.css
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed and saved.
*
* Add your own CSS or Less to fully customize Atom.
* If you are unfamiliar with Less, you can read more about it here:
* http://lesscss.org
*/
@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:
*
# WP, ACF and PHP snippets
'.text.html.php:not(.source)':
'ACF Field':
'prefix': 'acf'
'body': '''
<?php the_field( '${1:field_name}' ); ?>
'''
'ACF Image':

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
#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;
@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';
@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 / 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 / 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