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
# Delete all posts with given post type | |
DELETE FROM wp_posts WHERE post_type = 'shop_order'; | |
# Delete all orphaned post_meta | |
DELETE wp_postmeta FROM wp_postmeta | |
WHERE NOT EXISTS ( | |
SELECT * FROM wp_posts | |
WHERE wp_postmeta.post_id = wp_posts.ID | |
); |
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
# Find the largest tables in your MySQL database | |
SELECT | |
table_name as "Table", | |
table_rows as "Rows", | |
data_length as "Length", | |
index_length as "Index", | |
round(((data_length + index_length) / 1024 / 1024),2) as "Size (mb)" | |
FROM information_schema.TABLES | |
WHERE table_schema = "%%YOURDATABASE%%" | |
ORDER BY `Size (mb)` DESC |
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 | |
define('DOING_AJAX', true); | |
if ( ! isset( $_POST['action'] ) ) | |
die('-1'); | |
require_once('../../../../wp-load.php'); | |
// headers for JSON | |
header('Content-Type: application/json'); |
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
/** | |
* Auth0 Migration: Admin Page | |
* | |
* Provide a UI in the WP admin for migrating users to Auth0 | |
*/ | |
public function auth0_admin_page() { | |
// requires admin privledges | |
if ( current_user_can('manage_options') ) { |
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
// install solr client package: `npm install solr --save` | |
var solr = require( 'solr-client' ); | |
// client connects to solr host | |
var client = solr.createClient({ | |
host : host, | |
port : port, | |
core : core, | |
path : path, | |
agent : agent, |
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
# Elements | |
Fundamental building blocks of MIT Technology Review's digital styles. | |
## Doctype | |
{{ organization }} makes use of certain HTML elements and CSS properties that require the use of the HTML5 doctype. Include it at the beginning of all your projects. | |
### HTML | |
```html | |
<!DOCTYPE html> | |
<html lang="en"> |
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
/** | |
* DFP Test Page Controller | |
* | |
* This pulls in the data we need to output | |
* a story URL | |
* | |
* @pattern /dfp/ | |
*/ | |
'use strict'; |
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
/** | |
* /in/profile/edit | |
*/ | |
'edit': { | |
auth: { | |
mode: "try", | |
strategy: global.__config.cookie.strategy | |
}, | |
plugins: { | |
"hapi-auth-cookie": { |
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
.navbar__mobile-search__close { | |
display: none; | |
@include mq($nav-02) { | |
@include input-default; | |
display: block; | |
@include absolute(20px 20px n n); | |
@include size(20px); | |
background: #fff; |
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
{ | |
"id": 596818, | |
"title": "An Indian male journalist couldn’t handle a leading Bollywood actor’s pornographic past", | |
"slug": "an-indian-male-journalist-couldnt-handle-a-leading-bollywood-actors-pornographic-past", | |
"permalink": "http:\/\/qz.com\/596818\/an-indian-male-journalist-couldnt-handle-a-leading-bollywood-actors-pornographic-past\/", | |
"date": { | |
"published": "2016-01-19 06:08:01", | |
"updated": "2016-01-19 07:22:36", | |
"pretty": "January 19, 2016" | |
}, |