Deploy via FTP

My web hosting is a low-cost one and doesn’t provide a SSH access. I can’t use Octopress’ deployment methods, only FTP.

Tired of drag-and-dropping my files in FileZilla, I decided to use lftp and to configure the Rakefile accordingly.

Brainfuck part 3: a brainfuck → JavaScript transpiler

This article is part of a series on brainfuck, a weird programming language:

  1. Brainfuck part 1: what is it?
  2. Brainfuck part 2: an interpreter in JavaScript
  3. Brainfuck part 3: a brainfuck → JavaScript transpiler

Goal

In the last article of this series on brainfuck, I will write a brainfuck → JavaScript transpiler. Instead of interpreting each brainfuck instruction, it will be converted into a JS function once and for all.

Brainfuck part 1: what is it?

This article is part of a series on brainfuck, a weird programming language:

  1. Brainfuck part 1: what is it?
  2. Brainfuck part 2: an interpreter in JavaScript
  3. Brainfuck part 3: a brainfuck → JavaScript transpiler

Brainfuck is an esoteric programming language using only eight characters ><+-.,[]. It has no pratical use but it’s fun and challenges the mind.

Design

The language has only eight commands: the eight characters. Any other character is ignored and can be use for commenting.

The programming model is simple: you have a 30,000 cells data array and a pointer to the current cell. You can modify the value of this cell, print it (ASCII output) or replace it with the value of the keyboard input.

  • > move the data pointer forward
  • < move the data pointer backward
  • + increments (+1) the current cell
  • - decrements (-1) the current cell
  • . outputs the current cell as an ASCII character
  • , reads one character from the input and writes it in the current cell
  • [ makes the program jump to the instruction after the matching ] if the current cell’s value is 0.
  • ] makes the program jump to the instruction after the matching [ if the current cell’s value is not 0.

Having only these commands is the ‘’fuck’’ part of brainfuck.

Remove Octopress' default blog/ directory

By default, Octopress deploys your posts, categories and archives to a /blog/ subdirectory. Here is how to remove that :

  • replace all /blog occurences by / in _config.yml
  • move source/blog/archives to source/ (you can delete blog/)
  • edit source/_includes/custom/navigation.html. Replace /blog/archives by /archives
  • edit source/index.html. Replace /blog/archives by /archives

That’s it.