Skip to content

Instantly share code, notes, and snippets.

View cleancoded's full-sized avatar

James cleancoded

View GitHub Profile
@cleancoded
cleancoded / mediavine-Test.md
Created August 9, 2019 15:40
Mediavine -Test

Mediavine -Test

  1. Given an API route for retrieving a specific record, do the following:
    1. Get the id param
    2. Return a 404 if the record isn't found
    3. Return a response with the record if it is found

Route format:

php
@cleancoded
cleancoded / woocommerce-stripe-change-form-style.css
Created March 30, 2019 11:07
[Stripe] Change the style of the Stripe Form for WooCommerce.
/* General iframe Background */
iframe {
background: #fff;
}
/* Update Credit Card Field */
#stripe-card-element {
background: #ffffff !important;
padding: 10px 5px !important;
margin: 5px 0px !important;
@cleancoded
cleancoded / index.html
Last active January 4, 2019 19:25
WAF Daily Time Entries Email
Timesheet: <b>January 4, 2019</b>
<br/><br/>
<table>
<thead>
<tr>
<th>Project</th>
<th>Task</th>
<th>Hours</th>
</tr>
</thead>
<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) {
exit;
}
/**
* Archive Template
*
@cleancoded
cleancoded / ajax-reg.js
Last active October 26, 2017 02:43 — forked from csknk/ajax-reg.js
Facade type function and related classes to control programmatic user-generation on the WordPress front-end. Forms are submitted with Ajax, with a working PHP fallback.
/**
* This file is enqueued by means of wp_enqueue_script() - variables are passed
* in from PHP by means of wp_localize_script()
*
*/
/* TM: We use an anonymous function to invoke the JavaScript. Also refactored for proper
* WordPress coding standards.
*/
(function( $ ) {
@cleancoded
cleancoded / .gitignore
Created October 25, 2017 21:34
Ignore everything
# Ignore everything #
**
!wp-content/
wp-content/**
!wp-content/themes/
!wp-content/plugins/
wp-content/themes/**
wp-content/plugins/**
# Add two rules for each Theme or Plugin you want to include:
@cleancoded
cleancoded / page_featured_blog.php
Created October 25, 2017 21:33 — forked from ChristopherNeetz/page_featured_blog.php
Genesis page template with full blog post and additional posts with excerpts
<?php
/**
* Javascript for Load More
*
*/
function be_load_more_js() {
global $wp_query;
$args = array(
<?php
/**
* Template Name: Residential Portfolio
*
*/
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop
add_action( 'genesis_loop', 'custom_do_press_loop' ); // Add custom loop
function custom_do_press_loop() {
@cleancoded
cleancoded / functions.php
Created October 25, 2017 21:30
Display Posts Shortcode plugin: add H2 to title
<?php
//----------------------------------------------------------
// Display Posts Shortcode plugin: add H2 to title
//----------------------------------------------------------
add_filter( 'display_posts_shortcode_output', 'format_dps_title', 10, 9 );
function format_dps_title( $output, $original_atts, $image, $title, $date, $excerpt, $inner_wrapper, $content, $class ) {
// Make Title and H2
$title = ' <h3>'. $title .'</h3>';