This file contains 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
# SELECT any post_status | |
SELECT meta_value,COUNT(meta_value),GROUP_CONCAT(DISTINCT post_id ORDER BY post_id SEPARATOR ',') post_id | |
FROM wp_postmeta | |
WHERE meta_key = '_sku' | |
AND meta_value != '' | |
GROUP BY meta_value HAVING COUNT(meta_value) > 1 | |
# SELECT only from products that are already published or in draft | |
SELECT meta_value,COUNT(meta_value),GROUP_CONCAT(DISTINCT post_id ORDER BY post_id SEPARATOR ',') post_id | |
FROM wp_postmeta |
This file contains 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
import Ember from "ember"; | |
export default Ember.Object.extend({ | |
open: function(authentication){ | |
var userId = authentication.userId; | |
var token = authentication.accessToken; | |
var store = this.get('store'); | |
return new Ember.RSVP.Promise(function(resolve, reject){ | |
Ember.$.ajax({ | |
type: "POST", |
This file contains 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
// Q sample by Jeff Cogswell | |
/*=========== | |
We want to call these three functions in sequence, one after the other: | |
First we want to call one, which initiates an ajax call. Once that | |
ajax call is complete, we want to call two. Once two's ajax call is | |
complete, we want to call three. | |
BUT, we don't want to just call our three functions in sequence, as this quick |
This file contains 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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
#Removes access to the system folder by users. | |
#Additionally this will allow you to create a System.php controller, | |
#previously this would not have been possible. | |
#'system' can be replaced if you have renamed your system folder. | |
RewriteCond %{REQUEST_URI} ^system.* | |
RewriteRule ^(.*)$ /index.php?/$1 [L] |
This file contains 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 | |
/* | |
* Converts CSV to JSON | |
* Example uses Google Spreadsheet CSV feed | |
* csvToArray function I think I found on php.net | |
*/ | |
header('Content-type: application/json'); | |
// Set your CSV feed |