This file contains hidden or 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
function process_test_json() { | |
var jsonDataArr = { "Errors":[],"Success":true,"Data":{"step0":{"collectionNameStr":"dei_ideas_org_Private","url_root":"http:\/\/192.168.1.128:8500\/dei-ideas_org\/","collectionPathStr":"C:\\ColdFusion8\\wwwroot\\dei-ideas_org\\wwwrootchapter0-2\\verity_collections\\","writeVerityLastFileNameStr":"C:\\ColdFusion8\\wwwroot\\dei-ideas_org\\wwwroot\\chapter0-2\\VerityLastFileName.txt","doneFlag":false,"state_dbrec":{},"errorMsgStr":"","fileroot":"C:\\ColdFusion8\\wwwroot\\dei-ideas_org\\wwwroot"}}}; | |
var htmlStr= "<h3 class='recurse_title'>[jsonDataArr] struct is</h3> " + recurse( jsonDataArr ); | |
alert( htmlStr ); | |
$( document.createElement('div') ).attr( "class", "main_div").html( htmlStr ).appendTo('div#out'); | |
$("div#outAsHtml").text( $("div#out").html() ); | |
} | |
function recurse( data ) { | |
var htmlRetStr = "<ul class='recurseObj' >"; |
This file contains hidden or 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
// Get the height of the header | |
var headerHeight = jQuery(".navbar-fixed-top").height(); | |
// Attach the click event | |
jQuery('a[href*=#]').bind("click", function(e) { | |
e.preventDefault(); | |
var target = jQuery(this).attr("href"); //Get the target | |
var scrollToPosition = jQuery(target).offset().top - headerHeight; |
This file contains hidden or 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
<style> | |
.popup { | |
width:100%; | |
position:fixed; | |
z-index:99999999; | |
bottom:0px; | |
left: 50%; | |
transform: translateX(-50%); | |
text-align:center; | |
font-family: Open Sans; |
This file contains hidden or 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
/** | |
* Check an href for an anchor. If exists, and in document, scroll to it. | |
* If href argument omitted, assumes context (this) is HTML Element, | |
* which will be the case when invoked by jQuery after an event | |
*/ | |
function scroll_if_anchor(href) { | |
href = typeof(href) == "string" ? href : $(this).attr("href"); | |
// If href missing, ignore | |
if(!href) return; |
This file contains hidden or 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
ALTER TABLE `[table name]` | |
ADD COLUMN `id` INT NOT NULL AUTO_INCREMENT FIRST, | |
ADD PRIMARY KEY (`id`); |
This file contains hidden or 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 | |
$visitor = $_SERVER['REMOTE_ADDR']; | |
if (preg_match("/192.168.0.1/",$visitor)) { | |
header('Location: http://www.yoursite.com/thank-you.html'); | |
} else { | |
header('Location: http://www.yoursite.com/home-page.html'); | |
}; | |
?> |
This file contains hidden or 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: Your Plugin's Name | |
Plugin URI: http://plugin-homepage | |
Description: A description of your plugin. | |
Version: 0.1 | |
Author: Your Name | |
Author URI: http://author-homepage | |
License: GPLv2 or later | |
License URI: http://www.gnu.org/licenses/gpl-2.0.html |
This file contains hidden or 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 | |
/* hex to rgba - place in functions.php */ | |
function hexToRgb($hex, $alpha = false) { | |
$hex = str_replace('#', '', $hex); | |
$length = strlen($hex); | |
$rgb['r'] = hexdec($length == 6 ? substr($hex, 0, 2) : ($length == 3 ? str_repeat(substr($hex, 0, 1), 2) : 0)); | |
$rgb['g'] = hexdec($length == 6 ? substr($hex, 2, 2) : ($length == 3 ? str_repeat(substr($hex, 1, 1), 2) : 0)); | |
$rgb['b'] = hexdec($length == 6 ? substr($hex, 4, 2) : ($length == 3 ? str_repeat(substr($hex, 2, 1), 2) : 0)); | |
if ( $alpha ) { | |
$rgb['a'] = $alpha; |
This file contains hidden or 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
//remove wordpress authentication | |
remove_filter('authenticate', 'wp_authenticate_username_password', 20); | |
add_filter('authenticate', function($user, $email, $password){ | |
//Check for empty fields | |
if(empty($email) || empty ($password)){ | |
//create new error object and add errors to it. | |
$error = new WP_Error(); |
This file contains hidden or 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 | |
/*** | |
* Change Hex to RGBA | |
* Change the number after each variable for each usage | |
* Change the sub_field ID each time. | |
* use 'echo $color*' for Hex | |
* use 'echo $rgba*' for RGBA | |
***/ | |
$color1 = the_sub_field( 'pe_5050_image_grid_title_background_colour' ); | |
$rgba1 = hex2rgba($color1, 0.82); |