Linked content

The LaTeX Font Catalogue

Gallery of fonts you can use without much hassle in LaTeX. The license of the fonts vary, but are all free. Note that the fonts not necessarily are free to distribute, and some fonts are available for non-commercial use only.

Request a non-HTML format in controller specs

If a controller action responds to other formats than HTML (XML, PDF, Excel, JSON, …), you can reach that code in a controller spec like this:

describe UsersController do
  describe '#index' do
    it 'should be able to send an excel file' do
       # stubs and expectations go here
       get :index, :format => 'xls'

Remember that both the :format parameter and the HTTP_ACCEPT header can m…

Fix permissions of temporary RTeX files (which are group and world-readable)

We use RTeX for PDF exports.
While converting LaTeX to PDF, RTeX opens a temporary file which has problematic permissions: Both group and world can read those files.

Although the temp files should go away they sometimes live longer than one would expect.
We patched RTeX to fix this (and have more secure permissions). Place the code below into config/initializers/rtex.rb

Count lines of code

The following counts all the lines in all *.rb files in the app directory. Run several of these commands to get a rough estimate of the LOC.

find app -name *.rb -exec wc {} \; | awk '{a+=$1;print a}' | tail -1

MySQL replication how-to

This may be awkward to set up, but will work once you're done.

Fun facts:

  • In case of a connection loss the slave will try to reconnect to the master server and resume replication for the next 24 hours
  • If you want to use your slave as a "real" MySQL server, you basically need to switch off replication (STOP SLAVE; RESET SLAVE; and reset your my.cnf) and restart the MySQL daemon.

Master server configuration

  • Create replication user
    In the MySQL shell:
    CREATE USER 'replicator'@'%' IDENTI...
Linked content

Rethinking PDF Creation in Ruby

We're excited to announce PDFKit, an open source library that makes working with wkhtmltopdf a snap.

Linked content

wkhtmltopdf - Project Hosting on Google Code

Simple shell utility to convert html to pdf using the webkit rendering engine, and qt.

Linked content

michaeldv's awesome_print at master - GitHub

Pretty print your Ruby objects with style – in full color and with proper indentation

Linked content

Ruby Ghostscript by Shairon Toledo

Ruby Ghostscript (RGhost) is a library for document developers wanting a quick and easy way to generate pdf files. It's optimized to work with larger documents.

Linked content

jspdf - Project Hosting on Google Code

jsPDF is an open-source library for generating PDF documents using nothing but Javascript. You can use it in a Firefox extension, in Server Side Javascript and with Data URIs in some browsers.

Linked content

A List Apart: Articles: Unwebbable

An example of the conundrum of transferring print documents to the web, one that has become legendary in some circles, is the film screenplay.

This website uses cookies to improve usability and analyze traffic.
Accept or learn more