-
Install rbenv.
-
Download and compile OpenSSL 0.9.8x:
$ tar zxvf openssl-0.9.8x.tar.gz $ cd openssl-0.9.8x $ ./config $ make $ make test $ make install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
INPUT_FILE=$1 | |
if [ -z $INPUT_FILE ]; then | |
echo "You have to give an input file." | |
exit 1 | |
fi | |
# TODO: Add --stream if the file is bigger than n Kbytes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- plugin.xml --> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<plugin id="org.dita.ooxml"> | |
<feature extension="dita.conductor.transtype.check" value="ooxml"/> | |
<feature extension="dita.conductor.target.relative" value="integrator.xml" type="file"/> | |
<feature extension="dita.conductor.lib.import" file="lib/xfc.jar"/> | |
</plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="xfc"> | |
<macrodef name="xfc" description="XMLmind XSL-FO Converter"> | |
<attribute name="inFile"/> | |
<attribute name="outFile"/> | |
<attribute name="outputFormat" default="docx"/> | |
<attribute name="prescaleImages" default="true"/> | |
<attribute name="singleSidedLayout" default="false"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xslt style="${xsl.stylesheet}" extension="${output.file.extension}" classpathref="classpath" | |
filenameparameter="input.file" out="${output.dir}${file.separator}${input.file.basename}" | |
in="${input.file}" destdir="${output.dir}" filedirparameter="input.dir" basedir="${input.dir}"> | |
<factory name="net.sf.saxon.TransformerFactoryImpl"> | |
<attribute name="http://saxon.sf.net/feature/linenumbering" value="true"/> | |
</factory> | |
</xslt> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raise "You can only use #{__FILE__} with JRuby." unless RUBY_PLATFORM == "java" | |
require "java" | |
require "uri" | |
module XSLT | |
TRANSFORMER_FACTORY = "javax.xml.transform.TransformerFactory" | |
import "javax.xml.transform.TransformerFactory" | |
import "javax.xml.transform.Transformer" | |
import "javax.xml.transform.stream.StreamSource" |
Ant throws an error like the one below when you try to run it:
java.lang.NullPointerException
at org.apache.tools.ant.launch.Locator.getLocationURLs(Locator.java:524)
at org.apache.tools.ant.launch.Locator.getLocationURLs(Locator.java:475)
at org.apache.tools.ant.launch.Launcher.getUserURLs(Launcher.java:360)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
xmlns:java="http://www.java.com/" | |
exclude-result-prefixes="java xs"> | |
<xsl:function name="java:file-exists" xmlns:file="java.io.File" as="xs:boolean"> | |
<xsl:param name="file" as="xs:string"/> | |
<xsl:param name="base-uri" as="xs:string"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fcd() { echo "$(($(ls -1 "$1" | wc -l) - $(ls -1 "$2" | wc -l)))" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var factorial = function (n) { | |
var a = []; | |
var calculate = function (n) { | |
if (n < 2) return 1; | |
if (a[n] > 0) return a[n]; | |
else return a[n] = calculate(n - 1) * n; | |
}; | |
calculate(n); |