This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Function Partial : Custom Post Types | |
add_action('init', 'turbo_custom_post_types'); | |
// Register Custom Post Type | |
function turbo_custom_post_types() { | |
$types = array( | |
array( | |
'the_type' => 'work', | |
'single' => 'Work Item', | |
'plural' => 'Work Items', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function ar_responsive_image($image_id,$image_size,$max_width){ | |
// check the image ID is not blank | |
if($image_id != '') { | |
// set the default src image size | |
$image_src = wp_get_attachment_image_url( $image_id, $image_size ); | |
// set the src set with various image sizes | |
$image_srcset = wp_get_attachment_image_srcset( $image_id, $image_size ); | |
// generate the markup for the responsive image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## right time prompt | |
RPROMPT='[%t]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function ar_ig_get_photos() { | |
// set end point (json) | |
$endpoint = "https://api.instagram.com/v1/users/etc-json"; | |
// Initiate curl | |
$ch = curl_init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> | |
<title>My App</title> | |
<style type="text/css"> | |
body { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WP, ACF and PHP snippets | |
'.text.html.php:not(.source)': | |
'ACF Field': | |
'prefix': 'acf' | |
'body': ''' | |
<?php the_field( '${1:field_name}' ); ?> | |
''' | |
'ACF Image': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# shutdown.sh | |
echo "--- Remote iMac Shutting Down......"; | |
osascript -e 'tell application "Finder" to shut down'; |