Skip to content

Instantly share code, notes, and snippets.

View mojavelinux's full-sized avatar

Dan Allen mojavelinux

View GitHub Profile
@mojavelinux
mojavelinux / asciimath.adoc
Last active March 29, 2017 07:42
Demo of AsciiMath in AsciiDoc
\$sum_(i=1)^n i^3=((n(n+1))/2)^2\$
AsciiDoc source
:stem: asciimath
@mojavelinux
mojavelinux / table.adoc
Created March 14, 2017 04:17
AsciiDoc table with tabular (tab-separated) data
Column A Column B Column C

A1

B1

C1

A2

B2

C2

@mojavelinux
mojavelinux / angular-localizer-treeprocessor.rb
Last active March 7, 2017 17:17 — forked from jaredmcateer/wrap-text-with-filter.rb
An Asciidoctor treeprocessor that wraps text content in Angular's localize filter.
#!/usr/bin/env ruby
require 'asciidoctor/extensions'
class AngularLocalizerTreeprocessor < Asciidoctor::Extensions::Treeprocessor
def process document
document.blocks? ? (localize_blocks document) : nil
end
def localize_blocks node
@mojavelinux
mojavelinux / apache-tomee-datanucleus.adoc
Last active April 28, 2017 15:12
Instructions for how to switch to DataNucleus as the JPA provider when testing with or deploying to Apache TomEE.

Using DataNucleus as the JPA provider in Apache TomEE

DataNucleus can be used as an alternate JPA provider in TomEE. This document describes how to make this switch. These instructions assume you are using container-managed JPA.

@mojavelinux
mojavelinux / build.gradle
Last active March 2, 2017 18:00
A Gradle build that generates a versioned PDF for multiple AsciiDoc documents. Separate tasks are used for illustrative purposes and to allow each conversion to be individually configured.
buildscript {
dependencies {
classpath 'org.asciidoctor:asciidoctorj:1.5.4.1'
}
}
plugins {
id 'org.asciidoctor.convert' version '1.5.3'
id 'com.github.jruby-gradle.base' version '1.3.3'
}
@mojavelinux
mojavelinux / jdk-install-path.sh
Created January 8, 2017 03:33
A portable way to get the install path of the current JDK.
#!/bin/sh
jrunscript -e 'print(java.lang.System.getProperty("java.home").replaceAll("\\"+java.io.File.separator+"jre$",""))'
@mojavelinux
mojavelinux / slide-transformer.rb
Last active December 2, 2016 00:04
Reconfigure AST to convert all blocks with the role SLIDE into sections and transferring the content to those new sections.
require 'asciidoctor/extensions'
# Reconfigure AST to convert all blocks with the role SLIDE into
# sections and transferring the content to the new sections.
Asciidoctor::Extensions.register do
treeprocessor do
process do |doc|
doc.blocks.replace (doc.find_by role: 'SLIDE').map {|slide|
slide.parent.blocks.delete slide
sect = Asciidoctor::Section.new doc, 1, false

First stack

NormalCachingCallSite(CachingCallSite).callBlock(ThreadContext, IRubyObject, IRubyObject, Block) line: 143
NormalCachingCallSite(CachingCallSite).callIter(ThreadContext, IRubyObject, IRubyObject, Block) line: 154

California GOTV Script

Hi, is [VOTER NAME] available?

Hi [VOTER NAME]. My name is [NAME] and I’m a volunteer for Bernie Sanders. I was wondering, when you vote in the Democratic primary on Tuesday, can Bernie count on your support?

@mojavelinux
mojavelinux / atom-flight-manual.adoc.txt
Created March 27, 2016 08:47
Index file for generating a PDF for the Atom Flight Manual
= Atom Flight Manual
:source-highlighter: rouge
:toc:
:imagesdir: getting-started/sections/images
include::getting-started/index.asciidoc[lines=4..-1]
include::getting-started/sections/why-atom.asciidoc[lines=4..-1]