Sharpers

setting up heroku with a custom domain on Site5 steve Nov 30

Post a comment

In order for this blog to be reached at www.sharpers.com I completed the following:

heroku addons:add custom_domains
heroku domains:add www.sharpers.com
heroku domains:add sharpers.com

Now I go to site5.com to setup my DNS pointers:

Goto the site5 site admin page for the domain and click on Manage my domains -> DNS Zone Files alt text

Click on the "view/edit zone" file button alt text

Set the a name for * to 75.101.163.44, 75.101.145.87 and 174.129.212.295

alt text

You have to wait a while for it to resolve - to test if its ready yet:

host www.sharpers.com

Adding a project to git and heroku steve Nov 30

Post a comment

First - I have to say that blogcast needs an autosave feature - I nearly lost a previously drafted version of this. Fortunately, I have a chrome plugin called Lazarus installed which saved my bacon and retrieved the previous draft from a local store. [TODO] Could autosave be a feature I add to blogcast?


Assuming you already have accounts at both github and heroku, here are the necessary steps for managing a project (such as this new instance of blogcast!) in those two cloud based applications.

Adding project to github

Login to github and click on the "New Repository" button on the right hand side.

Change directory into the project you want to add. Create a new .gitignore:

.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
config/database.yml
db/schema.rb
nbproject/*
*~

From the command line:

git init
git add .
git commit -m 'first commit'
git remote add origin git@github.com:<username>/<project>.git
git push origin master

Pushing to a new Heroku project

heroku create
heroku db:push
git push heroku master

NOTE: The heroku db:push did not work. This created an issue when I tried to login as admin on the heroku instance of my blog, the admin user did not exist. Easy to get around by using the heroku console:

heroku console
User.create(:name => "Bob", :initials => "sph", :email => "admin@sharpers.com", :login => "admin", :password => "passw0rd", :password_confirmation => "passw0rd")

But I think there must be a way of seeding the database with the admin user (it is supposed to default to admin/admin - but I couldn't find the code where that occurs)

Blogcast, markdown and wmd-editor steve Nov 30

Post a comment

I read about blogcast in my news stream today and it looked like just what I was looking for:

  • Lightweight and quick to install
  • Uses Rails 3 so lets me get my hands dirty on that for the first time
  • Allows me to embed code into my postings and auto syntax highlights them using highlight.js

So lets get this thing going:

First of all I downloaded the blogcast zip from Tian Davis' website, extracted it into my Projects folder and started up the rails server. 5 minutes later I had this blog up and running locally - sweet!

Markdown?

Blogcast uses markdown. I've not had a huge amount of experience with that although I have played with it a little. There is a great reference to all the commands on Daring fireball. Here are a few I think I will be using significantly:

# heading   - this is a h1
## this is a h2
* unordered list item
1. Ordered list item

WMD Editor

Blogcast uses the wmd-editor. Which gives a few handy shortcuts for editing blog posts.

ctrl-k     - insert code
ctrl-l     - insert link
ctrl-b     - make **bold**