Skip to content

Instantly share code, notes, and snippets.

View eerohele's full-sized avatar

Eero Helenius eerohele

View GitHub Profile
@eerohele
eerohele / keybase.md
Created April 16, 2015 09:45
keybase.md

Keybase proof

I hereby claim:

  • I am eerohele on github.
  • I am eerohele (https://keybase.io/eerohele) on keybase.
  • I have a public key whose fingerprint is EE74 26FF 3791 94E1 C33A 209E 3DA0 E4C6 F612 121D

To claim this, I am signing this object:

@eerohele
eerohele / lxml.sh
Last active August 29, 2015 14:27
Statically compiling lxml on Ubuntu 15.04 and Python 3.3.3
# Apply https://github.com/mxe/mxe/blob/7e231efd245996b886b501dad780761205ecf376/src/libiconv-1-fixes.patch
CFLAGS="$CFLAGS -fPIC" STATIC_DEPS=true pip install lxml
{:user
{:plugins [[lein-exec "0.3.1"]
[lein-typed "0.3.5"]
[lein-try "0.4.3"]
[lein-midje "3.1.3"]
[lein-autoreload "0.1.0"]
[venantius/ultra "0.3.4"]
[jonase/eastwood "0.2.1"]
[lein-bikeshed "0.2.0"]
[lein-kibit "0.0.8"]
@eerohele
eerohele / map.clj
Created September 4, 2015 21:11
Implement map with reduce
(defn map' [f xs] (reduce (fn [x y] (conj x (f y))) [] xs))
@eerohele
eerohele / run.sh
Created September 11, 2015 11:47
Publish DITA content with DITA-OT and GNU Parallel
# Publish every .ditamap file in a directory in parallel.
# Use a DITAVAL file with the same basename as the .ditamap file for filtering.
find "$input_dir" -name "*.ditamap" | \
parallel -I{} bash dita -i "{}" -filter "$input_dir/{/.}.ditaval" -f pdf -o "$output_dir"
@eerohele
eerohele / TableTest.html
Created September 25, 2015 06:12
dita-ot/dita-ot #2057
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en-us" lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="copyright" content="(C) Copyright 2005"/>
<meta name="DC.rights.owner" content="(C) Copyright 2005"/>
<meta name="DC.Type" content="concept"/>
<meta name="DC.Title" content="Table test"/>
@eerohele
eerohele / normalized.xsl
Created September 30, 2015 08:53
DITA-OT XSLT stylesheet performance optimization
<?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"
exclude-result-prefixes="xs">
<xsl:output method="text"/>
<xsl:template match="/">
@eerohele
eerohele / Rakefile
Created February 16, 2012 21:19
A simple Rakefile for running RSpec, Cucumber, or both.
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
namespace :test do
desc 'Run RSpec tests'
RSpec::Core::RakeTask.new(:spec) do |task|
task.rspec_opts = %w[--color --format documentation]
task.pattern = 'spec/*_spec.rb'
end
@eerohele
eerohele / gemspec.rb
Created February 16, 2012 21:36
A template for a RubyGem specification.
require 'rake/gempackagetask'
# RubyGems versioning policy: http://docs.rubygems.org/read/chapter/7
gemspec = Gem::Specification.new do |gs|
gs.name = 'name'
gs.summary = 'summary'
gs.description = File.read(File.join(File.dirname(__FILE__), 'README.md'))
gs.requirements = [ 'requirements' ]
gs.version = '0.0.1'
@eerohele
eerohele / fop.bat
Created July 24, 2012 10:19
A batch file for running FOP-to-PDF transformation on a .fo file
@echo off
:: PREREQUISITES:
:: DITA Open Toolkit must be installed and the DITA_HOME environment variable
:: must be correctly set.
:: USAGE:
:: fop.bat filename.fo filename.pdf
:: Set input and output files.