Skip to content

Instantly share code, notes, and snippets.

@elliottslaughter
elliottslaughter / test.md
Created February 19, 2012 19:00
Pandoc 1.9.1.1 Page Numbering Bug

% Test TOC

Section A

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris ultricies laoreet risus et semper. Vestibulum sed turpis augue. Integer dictum aliquam nulla quis varius. Morbi vitae enim est. Nulla ut tellus magna, et ultrices libero. Proin consectetur posuere neque, nec consequat magna dignissim eget. Aenean gravida sapien eget purus consectetur non cursus arcu pellentesque. Fusce pretium ipsum vel massa suscipit mollis. Morbi porttitor tincidunt semper. Proin auctor ultrices varius. Nam scelerisque dictum egestas. Sed lectus sem, pulvinar gravida commodo venenatis, congue vitae tellus. In sem ante, accumsan nec porta sed, convallis et risus. Sed rhoncus vehicula diam, quis cursus nisl laoreet vel. Fusce interdum neque sed odio tempus id lacinia mi feugiat. Nulla egestas nulla eget diam dapibus eleifend.

Nulla quis cursus sapien. Nunc non nisl libero. Aenean risus nisi, dignissim quis ultrices vitae, porttitor vel nibh. Pellentesque sit amet nulla et est rutrum tincidunt. Donec et s

import Data.List
import Text.Pandoc.Definition
import Text.Pandoc.JSON
import Text.Pandoc.Walk
-- This pass implements <div class="noindent"> by adding \noindent to
-- the start of every paragraph.
deindentParas :: Block -> Block
deindentParas (Para lines) =
Para (RawInline (Format "tex") "\\noindent " : lines)

Keybase proof

I hereby claim:

  • I am elliottslaughter on github.
  • I am slaughter (https://keybase.io/slaughter) on keybase.
  • I have a public key ASBoWr0wGnhfXhgdVpqIzvpCYvZp6kn87ZRMOnmgRduwCAo

To claim this, I am signing this object:

@elliottslaughter
elliottslaughter / test_cores.py
Last active June 29, 2020 05:59
Reproducer for TensorFlow CPU usage
from __future__ import print_function
import argparse
import time
import numpy as np
import tensorflow as tf
from tensorflow.python.client import timeline
parser = argparse.ArgumentParser()
struct st {}
local iseven = terralib.overloadedfunction("iseven")
local isodd = terralib.overloadedfunction("isodd")
terra iseven_int :: {st, int} -> bool
terra isodd_int :: {st, int} -> bool
iseven:adddefinition(iseven_int)
isodd:adddefinition(isodd_int)
terra iseven_int(self : st, x : int)
include(LLVMProcessSources)
include(LLVM-Config)
include(DetermineGCCCompatible)
function(llvm_update_compile_flags name)
get_property(sources TARGET ${name} PROPERTY SOURCES)
if("${sources}" MATCHES "\\.c(;|$)")
set(update_src_props ON)
endif()
$ rg --no-filename --only-matching 'lua[A-Za-z0-9_]+[(]' src/ | sort -u
luaK_exp2nextreg(
luaK_exp2val(
luaL_checkint(
luaL_checknumber(
luaL_checkstack(
luaL_checkstring(
luaL_error(
luaL_loadbuffer(
luaL_loadfile(
@elliottslaughter
elliottslaughter / micro_bench.py
Created April 13, 2019 04:26
Dask microbenchmark
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import sys
import time
import dask
import numpy as np
$ docker run -v `pwd`:/io terra/build-box:latest bash -c "cd /io && /hbb/bin/setuser builder ./hbb-builder.sh"
Holy build box activated
Prefix: /hbb_shlib
CFLAGS/CXXFLAGS: -g -O2 -fvisibility=hidden -I/hbb_shlib/include
LDFLAGS: -L/hbb_shlib/lib -static-libstdc++
STATICLIB_CFLAGS: -g -O2 -fvisibility=hidden -I/hbb_shlib/include -fPIC
SHLIB_CFLAGS: -g -O2 -fvisibility=hidden -I/hbb_shlib/include
SHLIB_LDFLAGS: -L/hbb_shlib/lib -static-libstdc++
+ mkdir -p /io/build
$ docker run -v `pwd`:/io terra/build-box:no-libcxx bash -c "cd /io && /hbb/bin/setuser builder ./hbb-builder.sh"
Holy build box activated
Prefix: /hbb_shlib
CFLAGS/CXXFLAGS: -g -O2 -fvisibility=hidden -I/hbb_shlib/include
LDFLAGS: -L/hbb_shlib/lib -static-libstdc++
STATICLIB_CFLAGS: -g -O2 -fvisibility=hidden -I/hbb_shlib/include -fPIC
SHLIB_CFLAGS: -g -O2 -fvisibility=hidden -I/hbb_shlib/include
SHLIB_LDFLAGS: -L/hbb_shlib/lib -static-libstdc++
+ mkdir -p /io/build