Skip to content

Instantly share code, notes, and snippets.

Jordan Cauley jdcauley

Block or report user

Report or block jdcauley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jdcauley
jdcauley / admin.js
Last active Nov 6, 2018
User Profile WP
View admin.js
jQuery(document).ready(function($){
var _custom_media = true,
_orig_send_attachment = wp.media.editor.send.attachment;
$('#upload_image_button').click(function(e) {
var send_attachment_bkp = wp.media.editor.send.attachment;
var button = $(this);
var id = button.attr('id').replace('_button','');
_custom_media = true;
View custom_field.php
function api_featured_images( $post ) {
$field = get_post_meta($post['id'], 'field_id', true);
return $field;
}
add_action('rest_api_init', function() {
register_rest_field( 'post, 'field_name', array(
'get_callback' => 'your_field_function'
));
});
View creation.json
{
"title": "Pancakes",
"author": "Chelsea Cauley",
"yield": "16 Pancakes ",
"suitable_for_diet": null,
"thumbnail_id": "425",
"thumbnail_uri": "http://barleyandcraft.com/wp-content/uploads/2018/09/CC77BE4B-7151-4CF9-9CDC-8691D42503AB.jpeg",
"description": null,
"category": "2",
"category_name": "Breakfast",
View ui-definition.json
[
{
"id": "2442598894",
"type": "setting",
"slug": "mv_create_copyright_attribution",
"value": null,
"data": {
"type": "text",
"label": "Default Copyright Attribution",
"instructions": "If left blank, the Create Card author will be displayed."
View fletch.js
class Fletch {
constructor(props) {
this.defaults = {}
if (props.root) {
this.defaults.root = props.root
}
this.send = this.send.bind(this)
this.post = this.post.bind(this)
View tomcat.conf
description "Tomcat Server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
setuid tomcat
setgid tomcat
View keybase.md

Keybase proof

I hereby claim:

  • I am jdcauley on github.
  • I am jdcauley (https://keybase.io/jdcauley) on keybase.
  • I have a public key ASAfS448VJzN7T8CN2hk278KXDVvGDsiiEmadqL7mfUzyAo

To claim this, I am signing this object:

@jdcauley
jdcauley / Custom Post Slider
Last active Oct 25, 2017
Wordpress Bootstrap Carousel using a custom Post
View Custom Post Slider
<div id="myCarousel" class="carousel slide">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
<li data-target="#myCarousel" data-slide-to="4"></li>
</ol>
<div class="carousel-inner">
<?php query_posts('post_type=features&showposts=1'); ?>
View user.js
process.env.NODE_ENV = 'test';
//Require the dev-dependencies
let chai = require('chai')
let chaiHttp = require('chai-http')
let server = require('../index.js')
let should = chai.should()
let faker = require('faker')
const Models = require('../db.js')
@jdcauley
jdcauley / user.js
Created Oct 9, 2017
Trying to figure out testing writing
View user.js
process.env.NODE_ENV = 'test';
//Require the dev-dependencies
let chai = require('chai')
let chaiHttp = require('chai-http')
let server = require('../index.js')
let should = chai.should()
let faker = require('faker')
const Models = require('../db.js')
You can’t perform that action at this time.