View string-replace.js
if ('a'.replace(/(z)|./, function(match, g1) { return typeof g1; }) !== 'undefined') {
String.prototype.replace = (function (native_method) {
return function (pattern, callback) {
if ( !== 'RegExp' || typeof callback !== 'function') {
return, pattern, callback);
var result = '', source = String(this), length = source.length, lastIndex = 0, index, match;
pattern.lastIndex = 0;
while ((match = pattern.exec(source))) {
index = match.index;
View Rakefile.rb
To use this build script, first install the bundler gem:
$ gem install bundler
Then use the `bundle` command to install the dependencies into the project:
$ rm -rf Gemfile.lock .bundle
bundle config --local git.allow_insecure true
bundle config --local build.nokogiri --use-system-libraries
View asciimath.adoc
\$sum_(i=1)^n i^3=((n(n+1))/2)^2\$
AsciiDoc source
:stem: asciimath
View table.adoc
Column A Column B Column C







View angular-localizer-treeprocessor.rb
#!/usr/bin/env ruby
require 'asciidoctor/extensions'
class AngularLocalizerTreeprocessor < Asciidoctor::Extensions::Treeprocessor
def process document
document.blocks? ? (localize_blocks document) : nil
def localize_blocks node
View apache-tomee-datanucleus.adoc

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.

View build.gradle
buildscript {
dependencies {
classpath 'org.asciidoctor:asciidoctorj:'
plugins {
id 'org.asciidoctor.convert' version '1.5.3'
id 'com.github.jruby-gradle.base' version '1.3.3'
jrunscript -e 'print(java.lang.System.getProperty("java.home").replaceAll("\\""jre$",""))'
View slide-transformer.rb
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 = doc, 1, false
View asciidoctor-pdf-stack-traces.adoc

First stack

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