Skip to content

Instantly share code, notes, and snippets.

const map = require('lodash').map
function GetShortCode (line) {
const shortcodeObj = {
shortcode: '',
content: '',
params: {}
}
// get shortcode from line (gets everything in between the first set of square brackets)
@jsindos
jsindos / acfql-inefficiency.sql
Created July 24, 2018 02:00
Describes inefficient sql queries generated by https://github.com/jsindos/acfql
/**
* PROBLEM 1: Access posts by WordPress category using the category name
* Category names are stored in the `wp_terms` table
*
* `wp_terms` has many `wp_term_relationships` and has primary key `term_id`
* `wp_term_relationships` belongs to `wp_terms` via key `term_taxonomy_id`
*
* `wp_post` has many `wp_term_relationships` and has primary key `id`
* `wp_term_relationships` belongs to `wp_post` via key `object_id`
*/
@jsindos
jsindos / accolade_backend
Created March 7, 2017 08:02
Bash scripts for running Accolade locally
#!/bin/bash
source ~/.virtualenvs/be_accolade/bin/activate
cd ~/code/be_accolade
osascript -e 'tell application "Terminal"
activate
tell application "System Events" to keystroke "t" using command down
repeat while contents of selected tab of window 1 starts with linefeed
delay 0.01
end repeat
do script "source ~/scripts/virtual-env-accolade.sh" in window 1
<html>
<head>
<title>NVD3 Tooltip Bug</title>
<script src="https://rawgit.com/mbostock/d3/master/d3.js"></script>
<script src="https://rawgit.com/novus/nvd3/master/build/nv.d3.js"></script>
<link rel="stylesheet" href="https://rawgit.com/novus/nvd3/master/build/nv.d3.css">
</head>
<body>
<div id="stackedchart">
<svg></svg>