Gist-powered writing.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


A Ruby implementation of built with Sinatra.


View a gist at Example:

View a list of a GitHub user's Gists at Example Only public Gists with renderable content are listed.

If you happen to be on a user subdomain, e.g., and you paste in a Gist ID that does not belong to that user, you will be redirected to the appropriate subdomain. Example: will redirect to, because jedfoster does not own that Gist.

Roughdraft supports GitHub Flavored Markdown, Textile, Haml, and plain text.

GitHub Flavored Markdown includes a number of improvements over Markdown, like fenced code blocks with syntax highlighting. Example:

require 'redcarpet'
markdown ="Hello World!")
puts markdown.to_html

Roughdraft's implementation of Haml does not support Ruby evaluation, and many Haml filters will result errors.

Plain text is rendered as Markdown.

Installation: Local

The app:

git clone
cd Roughdraft
mkdir tmp
touch tmp/restart.txt

Change the APP_DOMAIN constant in roughdraft.rb, line 68, to whatever local domain you want to use. I recommend using Pow for local development, especially on this project as the username subdomain feature doesn't work with IP addresses.

The GitHub API limits the number of unauthenticated requests to 60 per hour, which is too little for production and often even for development. To get around this you will need to register your app with GitHub. Once you have your client ID and secret, rename config/github.example.yml to config/github.yml and paste in your app's credentials. Mine looks something like this:

client_id: 9ef1xxxx
client_secret: 5784xxxxxxxx

You should now be able to submit up to 5000 requests per hour.

FAIR WARNING: Your client ID and secret should not be shared publicly. Do not commit github.yml to your repo, especially if you post your repo on GitHub. Read the instructions for configuring Heroku with your credentials, below.

# Restart Pow
touch tmp/restart.txt
# Rock and Roll

Installation: Heroku

heroku create
git push heroku
heroku open
# Rock and Roll

Change the APP_DOMAIN constant in roughdraft.rb, line 41, to whatever custom domain your app will use.

The user subdomain feature doesn't seem to work without a custom domain name (i.e. not the Heroku generated domain.) This may be fixed in a future release. See this article on custom domain names and Heroku.

GitHub authentication on Heroku

Since the YAML file with your API credentials is not committed to your repo, it won't be sent to Heroku, so we need another way of storing that information. Enter Heroku environment variables:

heroku config:set GITHUB_ID=9ef1xxxx
heroku config:set GITHUB_SECRET=5784xxxxxxxx
heroku open
# Rock and Roll, again.