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
/** | |
* Find all the genes from a DNA string file and using StorageResource class. | |
* | |
* @author (Elvis Morales) | |
* @version (1.0) | |
*/ | |
import edu.duke.*; | |
import java.io.File; |
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 | |
add_action( 'edit_form_advanced', 'force_post_title' ); | |
function force_post_title( $post ) { | |
// List of post types that we want to require post titles for. | |
$post_types = array( | |
'post', | |
'report', | |
// 'event', |
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
# In your Jenkins job configuration, select "Add build step > Execute shell", and paste this script contents. | |
# Replace `______your-plugin-name______`, `______your-wp-username______` and `______your-wp-password______` as needed. | |
# main config | |
WP_ORG_USER="______your-wp-username______" # your WordPress.org username | |
WP_ORG_PASS="______your-wp-password______" # your WordPress.org password | |
PLUGINSLUG="______your-plugin-name______" | |
CURRENTDIR=`pwd` | |
MAINFILE="______your-plugin-name______.php" # this should be the name of your main php file in the wordpress plugin |
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: WP All Import - Redirection AddOn | |
Description: Add a redirect for each post imported. | |
*/ | |
// If this file is called directly, abort. | |
if ( ! defined( 'WPINC' ) ) { | |
die; | |
} |
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 | |
// Sum all values from order_total column in completed orders, and return. | |
$qb = $em->createQueryBuilder(); | |
$qb = $qb | |
->select( 'SUM(e.orderTotal) as totalRevenue' ) | |
->from( '[Vendor]\[Package]\Entity\Orders', 'e' ) | |
->where( $qb->expr()->andX( | |
$qb->expr()->eq( 'e.orderStatus', ':status' ), | |
// $qb->expr()->in( 'e.state', array( 'queued', 'confirmed' ) ) |
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: WP-CFM SSOT | |
Description: Sets WP-CFM bundles as the Single Source of Truth. | |
*/ | |
// If this file is called directly, abort. | |
if ( ! defined( 'WPINC' ) ) { | |
die; | |
} |
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: WP-CFM SSOT | |
Description: Sets WP-CFM bundles as the Single Source of Truth for all tracked options. | |
*/ | |
// If this file is called directly, abort. | |
if ( ! defined( 'WPINC' ) ) { | |
die; | |
} |
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 | |
// wp-content/mu-plugins/wp-cfm-multi-env.php | |
// ... | |
// Return empty array to disable multi-environment feature. | |
function my_wpcfm_multi_env_disable( $environments ) { | |
return []; | |
} | |
add_filter( 'wpcfm_multi_env', 'my_wpcfm_multi_env_disable' ); |
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 | |
// wp-content/mu-plugins/wp-cfm-multi-env.php | |
// ... | |
function my_wpcfm_current_env_set( $env ) { | |
// Detect with your own code logic the current environment the WordPress site is running. | |
// Generally this will be defined in a constant inside `$_ENV` or `$_SERVER` super-globals. | |
// ... | |
$env = 'dev'; | |
return $env; |
NewerOlder