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 / index.php
Created Mar 16, 2017
return function
View index.php
function random_color(){
return 'purple';
}
$color = random_color();
random_color();
@jdcauley
jdcauley / Contract Killer 3.md
Created Dec 19, 2016 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer 3.md

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

View fields.php
function sponsor_fields(){
$sponsor_id = '';
if( isset( $_GET['post'] ) ){
$sponsor_id = get_post_meta( $_GET['post'], '_os_sponsor_id', true );
} else if( isset( $_GET['taxonomy'] ) ){
$sponsor_id = get_term_meta( $_GET['tag_ID'], '_os_sponsor_id', true );
} else {
return;
@jdcauley
jdcauley / array.js
Created Sep 28, 2016
what the crap
View array.js
driverInputs.each(function(i){
var data = $(this).getParams();
app.data.drivers.push(data);
if(!app.saved['drivers']){
app.saved['drivers'] = [];
}
var newCopy = app.model.driver.slice(0);
console.log(newCopy);
View trk.js
(function($, Cookies, undefined){
var dateObj = new Date(),
month = dateObj.getUTCMonth() + 1,
day = dateObj.getUTCDate(),
year = dateObj.getUTCFullYear(),
currentDate = year + "" + month + "" + day,
currentSession = {},
trimData = {},
visits = localStorage.getItem("foVisit");
View minc.php
<?php
/*
Plugin Name: MINC
*/
require_once('lib/CMB2/init.php');
class MINC_Fields {
@jdcauley
jdcauley / app.js
Created Jun 8, 2016
cardinal-ajax
View app.js
var request = $.ajax({
url: cardinal.apiURL + cardinal.namespace + '/campaign/',
cache: false,
crossDomain: true,
method: "GET",
dataType: "json"
});
request.done(function( response ) {
cardinal.data = response;
View unpack_form
unpack_form($post_id){
$data = get_field('membership_registration_form', $post_id);
print_r('<pre>');
print_r($data);
print_r('<pre>');
}
View functions.php
function is_even($number) {
$isEven = false;
if (is_numeric ($number)) {
if ( $number % 2 == 0) $isEven = true;
}
return $isEven;
}
View functions.php
function admin_scripts($hook) {
if ( 'post.php' != $hook ) {
return;
}
wp_enqueue_style('os/admin_style', get_template_directory_uri() . '/assets/admin/main.css', false, null);
wp_enqueue_script( 'os/admin_script', get_template_directory_uri() . '/assets/admin/main.js');
}
add_action( 'admin_enqueue_scripts', 'admin_scripts');
You can’t perform that action at this time.