Skip to content

Instantly share code, notes, and snippets.

View rbdixon's full-sized avatar

Brad Dixon rbdixon

  • Carve Systems
  • Atlanta, GA
View GitHub Profile
@rbdixon
rbdixon / toc.yml
Last active January 14, 2016 15:34
---
toc: true
...
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
"""
Pandoc filter to allow interpolation of metadata fields
into a document. %{fields} will be replaced by the field's
value, assuming it is of the type MetaInlines or MetaString.
"""
import sys
from pandocfilters import toJSONFilter, attributes, Span, Str, Table
[
{
"unMeta": {
"test": {
"c": [
{
"c": [
[],
[
{
@rbdixon
rbdixon / correct.json
Created March 4, 2016 14:24
Correct output
[
{
"unMeta": {
"test": {
"c": [
{
"c": [
[],
[
{
@rbdixon
rbdixon / wrong.json
Created March 4, 2016 14:25
Wrong output
[
{
"unMeta": {
"test": {
"c": [
{
"c": [
[],
[
{
@rbdixon
rbdixon / -
Created March 4, 2016 14:26
Diff correct vs. wrong
*** correct.json 2016-03-04 09:02:52.000000000 -0500
--- wrong.json 2016-03-04 09:22:15.000000000 -0500
***************
*** 392,398 ****
]
]
],
! "t": "Table"
}
]
#!/usr/bin/env python
"""
Pandoc filter to allow interpolation of metadata fields
into a document. %{fields} will be replaced by the field's
value, assuming it is of the type MetaInlines or MetaString.
"""
import sys
from pandocfilters import toJSONFilter, attributes, Span, Str, Table
@rbdixon
rbdixon / readme.md
Last active May 11, 2020 12:24
mitmproxy script to translate WBXML

Why did I do this? See post.

@rbdixon
rbdixon / gron.diff
Created April 26, 2018 18:20
Pandoc: YAML multiline string with embedded table parsing
$ diff -C 2 passes.gron fails.gron
*** passes.gron 2018-04-26 14:18:00.000000000 -0400
--- fails.gron 2018-04-26 14:19:36.000000000 -0400
***************
*** 61,85 ****
json.meta.table.c[0].c[4][1][1][0].c[0].t = "Str";
json.meta.table.c[0].c[4][1][1][0].t = "Plain";
- json.meta.table.c[0].c[4][2] = [];
- json.meta.table.c[0].c[4][2][0] = [];
- json.meta.table.c[0].c[4][2][0][0] = {};