⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
#!/bin/bash | |
brew_command=/usr/local/bin/brew | |
brew_cask_command="$brew_command cask" | |
echo '#!/bin/bash' | |
echo '' | |
echo 'trap ctrl_c INT' | |
echo 'function ctrl_c() {' | |
echo 'echo "** Trapped CTRL-C"' |
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 | |
class Mailer extends PHPMailer { | |
/** | |
* Save email to a folder (via IMAP) | |
* | |
* This function will open an IMAP stream using the email | |
* credentials previously specified, and will save the email | |
* to a specified folder. Parameter is the folder name (ie, Sent) |
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 | |
/* | |
Plugin name: Single user login | |
Plugin URI: | |
Description: | |
Author: Ben May | |
Author URI: | |
Version: 0.1 | |
*/ |
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
## Add thumbnail to post columns in Dashboard | |
``` | |
add_image_size( 'admin-list-thumb', 80, 80, false ); | |
// add featured thumbnail to admin post columns | |
function wpcs_add_thumbnail_columns( $columns ) { | |
$columns = array( | |
'cb' => '<input type="checkbox" />', | |
'featured_thumb' => 'Thumbnail', |
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
#!/bin/bash -e | |
## | |
# WordPress Installation and VirtualHost Creation | |
# | |
# Description: Installs a WordPress website in the ~/Sites folder, creates a homepage, | |
# cleans up the WP install a bit, deletes the akismet and hello dolly plugins, creates the permalinks, | |
# clones the roots/sage theme framework to the theme folder, deletes all the other WP default themes, | |
# installs/runs npm and bower and runs gulp to create the initial assets, adds a custom gitignore file | |
# to /wp-content, installs the roots/soil plugin, creates a git repo in wp-content, saves the WordPress |
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
#!/bin/sh | |
# Set DB Constants | |
DBHOST="localhost" | |
DBUSER="root" | |
DBPASS="123" | |
DBNAME="wp_$1" | |
# Set WP Constants | |
ADMIN_NAME="my_admin_account" |
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
<input type="file" name="file" id="file"> | |
<input type="submit" id="submit" name="Upload" onclick="upload();return false;"> | |
<script type="text/javascript"> | |
function upload(){ | |
var formData = new FormData(); | |
formData.append("action", "upload-attachment"); | |
var fileInputElement = document.getElementById("file"); | |
formData.append("async-upload", fileInputElement.files[0]); |
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 | |
/** | |
* [list_searcheable_acf list all the custom fields we want to include in our search query] | |
* @return [array] [list of custom fields] | |
*/ | |
function list_searcheable_acf(){ | |
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF"); | |
return $list_searcheable_acf; | |
} |
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
function rd_bulletproof_jquery() { | |
$protocol = ($_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; | |
$url = $protocol . '://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'; | |
wp_deregister_script('jquery'); | |
if (get_transient('google_jquery') == true) { | |
wp_register_script('jquery', $url, array(), null, true); | |
} | |
else { | |
$resp = wp_remote_head($url); | |
if (!is_wp_error($resp) && 200 == $resp['response']['code']) { |