Skip to content

Instantly share code, notes, and snippets.

@randyjensen
randyjensen / keybase.md
Created February 23, 2015 13:44
keybase.md

Keybase proof

I hereby claim:

  • I am randyjensen on github.
  • I am randyjensen (https://keybase.io/randyjensen) on keybase.
  • I have a public key whose fingerprint is 9D8D 4E0B 561A 61FD 2E8C DE76 2DE0 9CE1 D8CA C08F

To claim this, I am signing this object:

@randyjensen
randyjensen / gist:11261767
Created April 24, 2014 16:59
Ninja Forms Fields AJAX
The actual Ninja Form submission
"fields": {
"99": false,
"100": "Opt 2",
"101": [
"Check 2",
"Check 3"
]
},
@randyjensen
randyjensen / wordpress-custom-post-title-placeholder-text
Created November 29, 2013 02:46
Add custom "Enter title here" text in WordPress
// Change Placeholder text for Post/Page/CPT Title
add_filter( 'enter_title_here', 'change_title_placeholder' );
function change_title_placeholder( $title )
{
$screen = get_current_screen();
if ( 'POSTTYPE' == $screen->post_type ){
$title = 'Some custom text';
}
@randyjensen
randyjensen / new-ubuntu-1204-vagrant-box
Created November 26, 2013 19:59
Add a new Ubunut 12.04 Vagrant Box
vagrant box add precise64 http://files.vagrantup.com/precise64.box
@randyjensen
randyjensen / acf-dynamic-drop-down
Last active May 3, 2019 00:28
Advanced Custom Meta Fields Select Box Dynamically Created With a Looping Offset
function my_acf_load_field($field) {
$field['choices'] = array();
$post_type = 'xxxPOST-TYPE-NAMExxx'; // post type name
$acf_field_id = 'xxxACF-FIELD-IDcxxx'; //eg: field_52129dt7c49dd
$global_offset = 500; // whatever you want your looping offset to be
$num_props = wp_count_posts($post_type)->publish;
$num_props_pages = (intval($num_props/$global_offset)) + 1;
$offset_props = 0;
@randyjensen
randyjensen / new_gist_file
Created October 11, 2013 13:34
New Comp Record
object(SimpleXMLElement)#329 (42) {
["CompID"]=>
string(4) "7069"
}
["Property"]=>
object(SimpleXMLElement)#374 (61) {
["PropertyID"]=>
string(2) "21"
["CoStarID"]=>
string(6) "409537"
@randyjensen
randyjensen / social_network_metadata
Created August 30, 2013 01:20
Meta Data For Social Networks
Facebook Open Graph
<head>
<meta property="og:title" content="Title Goes Here">
<meta property="og:description" content="description-goes-here">
<meta property="og:type" content="your-content-type-goes-here"> (e.g., "article")
<meta property="og:url" content="http://www.your-site.com/">
<meta property="og:image" content="http://www.your-site.com/image.jpg">
<meta property="og:site_name" content="your-site-name">
<meta property="fb:admins" content="your-Facebook-page-user-ID">
@randyjensen
randyjensen / jquery_add_delay_remove
Created August 13, 2013 17:39
jQuery Add Class, Delay, Remove Class
$('.animated-selector').addClass('hidden').stop().delay(500).queue(function(){
$(this).removeClass('hidden');
});
@randyjensen
randyjensen / native_js_jquery
Created July 27, 2013 23:53
Native JS for jQuery Functions
//----Append HTML elements----
/* jQuery */
$(document.body).append("<div id='myDiv'><img src='im.gif'/></div>");
/* native equivalent */
var frag = document.createDocumentFragment();
var myDiv = document.createElement("div");
myDiv.id = "myDiv";
@randyjensen
randyjensen / sublime_pref
Created July 26, 2013 21:02
Sublime Text User Preferences File
{
"bold_folder_labels": true,
"detect_slow_plugins": false,
"caret_style": "phase",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
".gitkeep",
"dump.rdb"