Skip to content

Instantly share code, notes, and snippets.

View tripflex's full-sized avatar
🦋
in the zone

Myles McNamara tripflex

🦋
in the zone
View GitHub Profile
@tripflex
tripflex / tunlr
Last active August 26, 2015 01:04 — forked from phiggins42/tunlr
tunlr!
#!/usr/bin/env node
/*
tunlr - simple SSH tunnel management
usage: tunlr [options] [command]
options:
-q quiet. suppress console output.
@tripflex
tripflex / price-table-rcp.php
Created February 18, 2014 18:31
RCP Price Table Template for Jobify
<h2 style="margin-bottom: 0px;">
<span class="rcp_price" rel="<?php echo esc_attr( $level->price ); ?>">
<?php
if ($level->fee) {
$adjusted_price = (($level->price)+($level->fee));
echo $adjusted_price > 0 ? rcp_currency_filter( $adjusted_price ) : __( 'free', 'jobify' );
?>
</h2>
<small>*<?php echo rcp_currency_filter( $level->price ); ?> after first <?php echo $level->duration; ?> days.</small>
<?php
@tripflex
tripflex / gist:1b3adfe40e2ad4f41313
Last active August 29, 2015 14:01
Pods Frontend Shortcode to display Custom Post Type for current user
// Shortcode can be added like this
// [pods_by_current_user_cpt name="document" template="Document Template"]
//
// Supports all shortcode attributes from standard PODS shortcode:
// http://pods.io/docs/learn/shortcodes/pods/
add_shortcode( 'pods_by_current_user_cpt', 'pods_by_current_user_cpt' );
function pods_by_current_user_cpt( $atts, $content = null ) {
$current_user = wp_get_current_user();
@tripflex
tripflex / gist:6053f881a46c3b57e435
Created May 14, 2014 14:27
Pods form display/output user meta field (using label) when not added under User in Pods
$user = wp_get_current_user();
$pod = pods('user', $user->ID);
$out = $pod->form(array(
'first_name' => array(
'label' => 'First name',
'type' => 'text',
'options' => array(
'required' => true,
),
),
@tripflex
tripflex / gist:15159cb1d67b3930e99c
Created July 15, 2014 15:19
Jobify TGMPA Bug Fix, replace the contents of /inc/tgmpa/class-tgm-plugin-activation.php with the code below
<?php
/**
* Plugin installation and activation for WordPress themes.
*
* @package TGM-Plugin-Activation
* @version 2.4.0
* @author Thomas Griffin <thomasgriffinmedia.com>
* @author Gary Jones <gamajo.com>
* @copyright Copyright (c) 2012, Thomas Griffin
* @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later
SecRequestBodyAccess On
SecResponseBodyAccess On
SecResponseBodyLimitAction ProcessPartial
SecResponseBodyMimeType text/xml
<FilesMatch "xmlrpc.php">
# Block brute force attempts using xmlrpc.php as the vector
# Increment our counter when the xmlrpc API indicates a failure
SecRule REQUEST_BODY "wp\.getUsersBlogs" "id:13504,deny,chain,status:406,\
phase:4,t:none,t:urlDecode,chain,deny,\
$interests = get_resume_field( 'careers_interest' );
if ( ! empty( $interests ) ) {
if ( is_array( $interests ) ) {
foreach ( $interests as $selected_value ) {
$tax = get_term_by( 'id', (int) $selected_value, 'careers_interest' );
echo "<li>" . $tax->name . "</li>";
}
} else {
/**
* Submit Step
*/
public static function submit() {
global $job_manager, $post;
self::init_fields();
// Load data if neccessary
if ( ! empty( $_POST['edit_resume'] ) && self::$resume_id ) {
$fromEmail = "Server <server@mydomain.com>"
$smtpServer = "10.10.10.10"
$subject = "Random Subject"
$body = "Random Body"
$emailTo = "Myles <myles@myles.com>", "Bill <bill@bill.com>", "John <john@john.com>"
send-mailmessage -to $emailTo -from "$fromEmail" -subject "$subject" -body "$body" -smtpServer "$smtpServer" -BodyAsHtml