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
http://www.canadaseozone.com/web-services/xml-video-sitemap-generator/#show |
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
//npm install b64url | |
//A signed_request for testing: | |
//WGvK-mUKB_Utg0l8gSPvf6smzacp46977pTtcRx0puE.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImV4cGlyZXMiOjEyOTI4MjEyMDAsImlzc3VlZF9hdCI6MTI5MjgxNDgyMCwib2F1dGhfdG9rZW4iOiIxNTI1NDk2ODQ3NzczMDJ8Mi5ZV2NxV2k2T0k0U0h4Y2JwTWJRaDdBX18uMzYwMC4xMjkyODIxMjAwLTcyMTU5OTQ3NnxQaDRmb2t6S1IyamozQWlxVldqNXp2cTBmeFEiLCJ1c2VyIjp7ImxvY2FsZSI6ImVuX0dCIiwiY291bnRyeSI6ImF1In0sInVzZXJfaWQiOiI3MjE1OTk0NzYifQ | |
function parse_signed_request(signed_request, secret) { | |
encoded_data = signed_request.split('.',2); | |
// decode the data | |
sig = encoded_data[0]; | |
json = base64url.decode(encoded_data[1]); | |
data = JSON.parse(json); // ERROR Occurs Here! |
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
PATH=$PATH:/usr/local/share/npm/bin/ |
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
Put the following into ~/.ssh/config: | |
Host ec2.xxx.compute.amazonaws.com | |
User ec2-user | |
IdentityFile /path/to/the/my.pem |
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 | |
global $wp; | |
$current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) ); | |
?> |
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
$.each(data, function(name, val){ | |
var $el = $('#listify_form [name="'+name+'"]'), | |
type = $el.attr('type'); | |
switch(type){ | |
case 'checkbox': | |
$el.attr('checked', 'checked'); | |
break; | |
case 'radio': | |
$el.filter('[value="'+val+'"]').attr('checked', 'checked'); |
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 | |
echo do_shortcode( '[salesforce form="'.$form_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 | |
// Downgrade to jQuery given version | |
function downgrade_jquery() { | |
global $wp_scripts; | |
// We want to use version 1.8.3 of jQuery, but it may break something in the admin so we only load it on the actual site. | |
if ( !is_admin() ) : | |
wp_deregister_script('jquery'); | |
wp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js', false, '1.8.2'); | |
endif; |
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
$.fn.serializeObject = function() | |
{ | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function() { | |
if (o[this.name] !== undefined) { | |
if (!o[this.name].push) { | |
o[this.name] = [o[this.name]]; | |
} | |
o[this.name].push(this.value || ''); |
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 populate_form(data, form) { | |
$.each( data, function(name, value) { | |
// grab input | |
var input = $(":input[name='" + name + "']:not(:button,:reset,:submit,:image)", form ); | |
input.val( ( !$.isArray( value ) && ( input.is(':checkbox') || input.is(':radio') ) ) ? [ value ] : value ); | |
// populate select value | |
var select = $(":input[type='select']", form ); | |
if (select) { |