Epoch's posterous http://epochwolf.com It's only a model. posterous.com Tue, 06 Dec 2011 17:19:00 -0800 Net::HTTPBadResponse: wrong status line: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">" http://epochwolf.com/nethttpbadresponse-wrong-status-line-doctype http://epochwolf.com/nethttpbadresponse-wrong-status-line-doctype

If you ever see: Net::HTTPBadResponse: wrong status line "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">"

Then you probably forgot to use ssl with your request to port 443. Apache coughed up a 400 error page over ssl in a way that caused the ruby standard library Net::HTTP to vomit exceptions all over your application.

This behavior was discovered on with Ruby 1.8.7 patch level 352. Judging by how it affected all the development system at my work, it affects all Ruby 1.8.7 patch levels equally. I have no ideal what happens with Ruby 1.9.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Sat, 11 Jun 2011 11:31:00 -0700 New location, new job. http://epochwolf.com/new-location-new-job http://epochwolf.com/new-location-new-job

New Location 

 I moved out to Bothell, WA (Near Seattle, just north of Redmond) in the middle of May and I started a new job on May 31st. It's been an incredible experience for me. I have finally left my parent's place and gotten an apartment all to myself. There are so many cool places out here. It's going to take me a long time to find and visit all of them. 

New Job

I'm working for Vertafore which writes software for the insurance industry. I joined their PolicyIssuance team. This is worlds away from the jobs I had in Green Bay, WI. The PolicyIssuance team is incredible. In my first week I was part of a code review which looked at some new features being worked on. I was very critical of the code, especially for not knowing the code base well. Everyone took my comments well during the meeting and this last week I got to see the updated code and the developer had taken my suggestions to heart. The code was abstracted in a proper manner. It's just amazing that someone would listen to me when I'm so new and inexperienced. How many people will listen to someone that just jumped in three days ago? I have hopes that I'll be able to stay with this company for a few years or even longer. I've needed time and room to mature after graduating from college and I think I'll be given both there. 

Update on singleforest

I'm working on version two of the site which will be based on rails 3.1. The current version has some hacks that rails 3.1 fixes. There are also deep design flaws with the way the controllers are setup in to five separate namespaces requiring enormous code duplication which I thought was necessary months ago. 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Thu, 21 Apr 2011 12:51:00 -0700 Singleforest.com is open for signup http://epochwolf.com/singleforestcom-is-open-for-signup http://epochwolf.com/singleforestcom-is-open-for-signup

TL;DR Singleforest.com is deviantArt for literature. 

I created Singleforest.com to solve a problem that has long bothered me. Places like deviantArt are just not made for posting literature. Literature is listed and categorized in a way that makes it difficult for members to find an audience and for visitors to find stuff that they like. 

Singleforest is designed to address this in two ways. 

First, there is no visual artwork on the site. Literature should not have to compete with visual art. Visual art has a very low barrier to entry when it comes to enjoyment. It takes very little time to browse from image to image. Literature takes more time to enjoy. On Singleforest, everyone will be there to read.

Second, the list views are designed to be quickly scanned if you want to look for a specific story. If you look at the browse page, you will see the following information: title, author, word count, tags, and submission date. This list quickly provides information you will be looking for. The title and author are obvious. The word count gives you an idea of it's length. The list of tags supplement the title in helping describe the content of the story. Finally the submission date tells you how old the story is. If you just visited yesterday, you'll want to know what's new. 

This is what separates Singleforest apart from it's competitors. Singleforest has forums, user journals, and some other features, like a user-editable wiki, that most community sites have equivalents for. The hope is to attract a community that enjoys reading and writing because no matter how many features the site has, it's the community that will ultimately define Singleforest.com.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Thu, 14 Apr 2011 16:15:00 -0700 Singleforest Beta Soon (for real) http://epochwolf.com/singleforest-beta-soon-for-real http://epochwolf.com/singleforest-beta-soon-for-real

So close, I can taste it. Singleforest is nearly ready for beta. I've hammered the most the major bugs I'm aware of. 

What's left before launch?

  • Some of the custom logging code is storing passwords. That needs to get fixed before the site can go live.
  • Moving the server from Rackspace to WebbyNode. Waiting on WebbyNode to get debian 6 out. Will go with Ubuntu in a pinch. 
  • Need to write up Terms of Service and Rules documents. 

Some of the issues getting the site ready:

  • Getting SSL/nonSSL redirection working properly was not happening. 
    • Moved the entire site to ssl instead. Easier and more secure anyway.
  • Getting tests written for some of the code. RSpec fought me every step of the install process.
    • Releasing the beta with only minimal test coverage, will add tests as bugs pop up. 
  • Writing my own css was taking way too much time.
    • Purchased a theme for $20
    • Will fix some of the icky coloration later. (background too bright, link color too light) 
  • Event system was pretty complicated and was breaking a lot of code
    • Stripped events and notifications to the minimum that was required and stopped trying to ensure they get saved.
  • Spending too much time making the ajax stuff nicer
    • Stopped working on writing my own widget library and settled on a just works solution for now.

I can't wait to for this thing to be live. It's been way too long. 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Mon, 10 Jan 2011 17:25:00 -0800 Why I'm Using Rails 3 and SQL http://epochwolf.com/why-im-using-rails-3-and-sql http://epochwolf.com/why-im-using-rails-3-and-sql

Anyone who has followed my modest blog will be familiar with the various frameworks and databases I have tried using for singleforest.com. Well, I have finally come to a conclusion. A real conclusion this time. Since August 2010 I have been working with Rails 3 using SQLite3 as a database backend. For anyone on Hacker News that has met me in Chicago, this is the version I demoed on my iPad at the Publican.


I would like to review the frameworks and database previous iterations of singleforest.com used and why I am not using them today.

Frameworks

Rails 2
I originally started coding with rails 2. It was an easy decision to make since I had learned rails during my internship and I had continued to use it after the end of my internship. The first rails 3 beta was released early in my development process. I found rails 3 to be cleaner than earlier versions. The routing api was elegant instead of clunky. (Yes, specifying :controller and :action for every route is clunky even if you can scope them.) The addition of AREL to active record was also important once I started using sql databases, my current code base relies on it for automatic sorting and pagination.  As a result I made several attempts to use rails 3 which resulted in enormous amount of pain. During the betas several key gems such as authlogic, formtastic, and various active record gems were either not compatible or buggy. I was forced back to rails 2 until rails 3 was out of beta. Once 3 was out of beta I switched back to it.

Django
I had given Django some thought initially. I had played around with Django before and found it to be at least as large of a framework as Rails. I went with rails because of ruby. I hadn’t used python for almost a year when I started singleforest.com and I was looking at the start of a new semester in a few weeks.

Pylons
During my fights over whether to use Rails 2 or Rails 3, I decided to give a python framework a try. I dismissed Django for the same reasons as before, it’s too large of a framework to learn quickly. I figured I would be up to relearning python since I had enough free time between classes. Turns out relearning python wasn’t the problem, the documentation on pylons was. At the time I was learning pylons, the available documentation on the internet was out of date and pydoc refused to build the documentation for the version I was using. The only decent tutorial I could find was a half finished book on the previous version. I quickly ran into issues with the book. A quick trip to irc revealed to me there was no authoritative documentation, no tutorials for the current version, and no one had any idea how to actually build a pylons project from scratch. I was told to download a sample application (the pylon’s project website) and modify that. Upon doing that I found out I now had three different version of pylons on my system and all of them hated each other. I also had issues with python’s tooling. (Pydoc, virtualenv, and multiple package managers) In the end I went back to rails because I didn’t have the patience or time to deal with a pylons.

Databases

CouchDB
What’s not to love about CouchDB? From a system administrative perspective it’s the most awesome database ever. It’s crash-only, you can back it up with rsync, and it scales like nuts. From a programming perspective it’s a little more work. You need to define every query you will ever do before you do it. It’s not as bad as you think. CouchDB has a development mode that will run any query you want without an index. Slow as hell but flexible, you just have to define the indexes before you deploy. I can live with that. Data is stored as json documents in a single silo. I can live with that. For an old version of my application it would work fine. I would have loved to use it.

Why didn’t I? I need joins in the future. CouchDB could work if I was willing to make trade offs on future design. I plan to add groups to singleforest. The queries I would need can’t run on couchdb without a lot of denormalization. Adding and removing users from groups and calculating activity on groups would be expensive and require cron jobs. Ironically, groups wouldn’t be able to scale on CouchDB.

MongoDB
I liked using mongodb but the tradeoffs make me uncomfortable from a system administration perspective. MongoDB plays fast and loose with data to get high speeds as a result, it requires two servers for data safety. I don’t currently have the resources to deploy two database servers. I did not feel comfortable trying to maintain a single server against strong recommendations not to. Later I found another reason not to use MongoDB: I need joins.  

In Conclusion
Since rails 3 has matured it has been an absolute joy to work with. I do not regret having spent so much time switching between databases and frameworks. It’s given me a better appreciation for the tools I’m using now. Learning to model data in json has allowed me to model data better in sql. Fighting with python’s toolset has made me thankful for ruby version manager and bundler.

Project Update
Screenshots of the current version available on my deviantArt account.

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Sat, 09 Oct 2010 16:10:00 -0700 Thank you google groups... http://epochwolf.com/thank-you-google-groups http://epochwolf.com/thank-you-google-groups

I just found out that google groups is no longer providing pages in groups. This means I can't use google groups as a wiki for my site. I'll have to find a different solution. 

Short update.

  • I've moved singleforest.com back to a sql database. Json just couldn't model some of the future ideas I have flexibly and efficiently. 
  • I've working at WS Packaging for a month now as an "Internet Services Developer" and loving it.
  • And I don't know when I'll be deploying singleforest.com. I'm so far behind on getting code done because of my new job. 

 

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Wed, 11 Aug 2010 18:19:00 -0700 A look at singleforest.com: polls http://epochwolf.com/a-look-at-singleforestcom-polls http://epochwolf.com/a-look-at-singleforestcom-polls

I've been getting a lot of work done on singleforest.com. I've got a week left to add features before I start tracking down bugs and getting my server ready for an August 30th deployment. 

Today I finished creating polls. I wasn't going to have polls as a feature to start with but they where so easy to create I figured, why not? (Still took two days...)

This is what a poll looks like. 

Monday_bad_poll
Nothing too fancy. It works though. One design note: I wanted people to be able to see what the current votes are before they decide what to vote.

Here's what it looks like when you click vote!

Monday_that_bad_voted
The asterisk tells you what you voted on and the green bar below the main navigation tells you that your vote has been saved.

And for a bonus, you can optionally make polls that allow people to vote on multiple answers!

Multiple_votes_poll
As you can see, there are two asterisks on this one. You also get a preview of fully functioning editable comments.

Here's a bonus screen shot of that comment's edits.

Comment_history
I've been very busy. :) 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Tue, 10 Aug 2010 07:13:00 -0700 Some stuff is allowed to break on purpose. http://epochwolf.com/some-stuff-is-allowed-to-break-on-purpose http://epochwolf.com/some-stuff-is-allowed-to-break-on-purpose
I was playing around with markdown and I discovered attempting to submit indented text breaks things rather nicely.
This is what indented text looks like when viewed.
Breaking_indents
With a black background you have no hope of reading the submission. Editing is even worse.
Missing_editor
The text box for editing has completely disappeared... wait, there is a horizontal scrollbar!
Missing_editor_found
Ah, there it is. That's going to be a pain to edit.

I didn't plan on breaking indented text this badly but it certainly works. I don't want any user-submitted content to have indentation. I have a very specific reason for this. I want to present every submission in the same, readable format. If you want indented text, I would be happy to use css to properly indent it for you! I want the text on singleforest to be readable and consistent when submitted. Using markdown enforces some level of standardization. Restricting allowed html helps even more. (CSS may work in the preview but you ain't getting colored fonts in your literature. Yeah, I remove the <font> tag too.)

As always, comments are welcome and you can keep up to date on the mailing list on google groups. 

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Wed, 04 Aug 2010 12:32:00 -0700 Google Group created for singleforest.com http://epochwolf.com/google-group-created-for-singleforestcom http://epochwolf.com/google-group-created-for-singleforestcom

I created a google group for singleforest.com at http://groups.google.com/group/singleforest. I choose to use google groups over dokuwiki to simplify the code I would have to support. Google groups does everything I needed the wiki to do without having to modify dokuwiki to integrate with rails. It also comes with a free mailing list. 

As you can read on the group, I plan to finally deploy the site late in August. We'll see if that happens. I've got a lot of work to do. 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Tue, 27 Jul 2010 09:26:00 -0700 Rails 3 RC injuries. http://epochwolf.com/rails-3-rc-injuries http://epochwolf.com/rails-3-rc-injuries

If you're going to run bleeding edge, you will bleed profusely. I nearly lost an arm today. I upgraded my application to Rails 3 rc from Rails 3 beta4. The list of problems I've encounter is not long but very annoying. 

  1. gem install rails --pre on top of existing rails beta causes vague untraceable errors just like upgrading to beta2 and beta3. 
    1. Solution is to remove all installed gems manually.
    2. Happily discover rvm has support for this. (rvm gemset clear)
    3. Install rails 3 rc and all dependencies. 
    4. While gems download find out in #rails-contrib that rails 3 rc isn't loading the lib/ folder
      1. Add "config.autoload_paths += %W(#{config.root}/lib)" to application.rb
    5. Ruby 1.9.1 segfautls on load. Joy of joys but not surprising.
  2. Try ruby 1.9.2-preview1
    1. Remove all installed gems
    2. Install rails 3 rc and application gems
    3. Instant sigabrt on running rails server
    4. Discover in #rails-contrib that preview1 is buggy as hell... (then why does rvm install 1.9.2 install preview1?)
  3. Try ruby 1.9.2-head
    1. No gems to remove because I need to update the head anyway.
    2. Download, compile, and install ruby 1.9.2-head
    3. Install rails 3 rc and application gems
    4. Instant internal server errors relating to failsafe failing. 
    5. #rails-contrib recommends 1.9.2-rc2
  4. Try ruby 1.9.2-rc2
    1. Not installed
    2. Download, compile, and install ruby-1.9.2-rc2
    3. Install rails 3 rc and application gems
    4. Instant internal server errors relating to failsafe failing. 
  5. Swear quietly and profusely
  6. Start testing
    1. Build new rails 3 rc application 
      1. launches okay with simple controller and view
      2. compare boot.rb, application.rb, environment/ and initializers/ with non-working app 
      3. no difference...
    2. Test difference configurations with non-working application
      1. Throw exception in home#index
      2. Works, controllers are probably okay
      3. Render index view without layout
      4. 500 Error
      5. Render index using erb instead of haml
      6. Works...
    3. Back to new rails 3 rc app
      1. Add haml gem to Gemfile and make a basic haml view
      2. Works okay. 
      3. Add haml configuration initializer from non-working application
      4. 500 Error
      5. Start playing around with different configuration options
      6. Discovered setting :encoding to :"utf-8" (notice the colon, :"" is a symbol, not a string)
      7. Using "UTF-8" (string) instead of :"utf-8" (symbol) works...
    4. Change :"utf-8" to "UTF-8" in non-working application
      1. Application works now.

I am now able to continue working on singleforest.com but I'm ready for a nap. I estimated this morning I would spend several hours just getting my application working again. For once I was correct. It only took several hours instead of the entire day. 

I would like to thank elux and nbibler in #rails-contrib on freenode for helping me out. 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Wed, 07 Jul 2010 11:48:00 -0700 Old version of singleforest.com available on github http://epochwolf.com/old-version-of-singleforestcom-available-on-g http://epochwolf.com/old-version-of-singleforestcom-available-on-g

I've deployed an old copy of singleforest.com on github at http://github.com/epochwolf/singleforest-old for all you voyeurs to see. It's the same copy you see in the screen shots. 

My current version of singleforest.com is quite different. I'm not using openid anymore. I wish I could have used OpenID but the rack-openid gem has issues with ruby 1.9's encoding scheme. My current version also uses Rails 3 and MongoDB instead of Rails 2.3.5 and SQLite. 

In other news, this blog is now linked to on my public cv at careers.stackoverflow.com. I won't link you directly to it but those of you interested can now find my real name.  (I give my family about a week before one of them discovers my posts to a certain art website.) My real name would have come out anyway, I figure now is as good as a time as any to let the cat^H^H^Hwolf out of the bag.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Wed, 16 Jun 2010 10:00:00 -0700 A brief, fragmented update on everything. http://epochwolf.com/a-brief-fragmented-update-on-everything http://epochwolf.com/a-brief-fragmented-update-on-everything

I've finally graduated with a Computer Science degree. My GPA was 2.866 or so. I'm just glad that's over with. I can't help that nagging feeling that I've wasted 4 years of my life.

I hammered out less ambitious plans for my literature website (singleforest.com) last night. I've decided to try getting rid of every feature that most art websites have. This isn't the most brilliant move I've had (yet) but it's one I need to get anything done. I want to experiment with using email and rss instead of a traditional message center. I'll probably need to rethink this at some point. That point being a significant number of annoyed users which I expect to happen a few months into the life of the site.

My maternal grandfather has been in the hospital for over two weeks now because of complications from lung surgery. He's going to need heart surgery for an eventually fatal heart defect but he needs to heal from the last surgery. It's been fairly stressful for me and my family. It's not the reason I've been silent for so long but it certainly isn't helping things.

On top of this, I'm getting depressed from lack of motivation and useful things to do. I'm still living at home with my parents and I really want to move out and start living my own life. I've having a difficult time with looking for jobs. It's a task that has very limited feedback if any, which is something I don't handle as well as I want to. I'm also frustrated by the lack of interesting programming opportunities in Wisconsin. I'd love to relocate but I can't take the financial risk unless I'd have a job waiting for me. I've applied at local java and .net shops but those jobs are absolutely flooded and given my lack of experience I'm not getting much consideration. Those of you that know me on irc will remember my trip to Eau Claire, I didn't get the job.

If you read all of that I thank you. Don't let my bad week keep you from enjoying yours!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Thu, 13 May 2010 13:23:00 -0700 Another snag! (I gotta stop doing this) http://epochwolf.com/another-snag-i-gotta-stop-doing-this http://epochwolf.com/another-snag-i-gotta-stop-doing-this

Well, I haven't done any programming related to singleforest.com for about two weeks. I've been working pretty hard on my final project. I just finished the presentation with my group and the professor said it was good enough to pass. I should be officially graduated in a week or two. 

I've come to realize my issues with this website are not based on technology. Took 5 months to realize this. I'm pretty sure if I had someone else to look over my shoulder this website would be done by now. I never sat down and hammered out what features I needed and how some of the stuff was going to work. You can't just tack on a full notifications system. You can't be working on a website this big without some automated testing. (Yes, my bad. I never learned to use testing.)

I had exactly 10 versions of singleforest.com sitting in my project folder. Five of them are working but incomplete versions. I don't know what I'm doing. I keep trying to add extra layers to things that don't need them because I don't know where to put stuff. I'm going to take a deep breath and relax tonight.

The last SciFi Club meeting of the year is tonight. I'm going to party with all my friends that I made before I leave this school permanently. Tomorrow, I'm going to go to an all day party and enjoy myself. Only after that will I sit down and figure out what I'm going to put into singleforest.com using ruby on rails. An anemic bullet list isn't going to be good enough this time. 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Thu, 29 Apr 2010 11:51:00 -0700 And the winner is: http://epochwolf.com/and-the-winner-is-142 http://epochwolf.com/and-the-winner-is-142

Pylons!

I'm still figuring out if I'm going with postgres or couchdb for the backend. I need to read more on pylons before I can make that decision. (I decided on this last night but I was too busy reading to post)

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Tue, 27 Apr 2010 18:29:00 -0700 Singleforest.com hits a major snag http://epochwolf.com/singleforestcom-hits-a-major-snag http://epochwolf.com/singleforestcom-hits-a-major-snag

Well I've been working on singleforest.com for a while. I made the mistake of choosing the Rails 3.0 beta with Ruby 1.9 for my application. I've spent almost at much time dealing with framework and library bugs as I have with writing code. Today I hit the final bug. The openid library I've been using doesn't work with several openid providers due to the way Ruby 1.9 handles string encoding. The library throws unhandled exceptions that I can't work around. I could try patching the library myself but I'm already working with 4 patched libraries that will likely not survive the next Rails 3.0 beta release. 

So, I've decided to walk away from rails for a bit. I know I could use Rails 2.3.5 with Ruby 1.8 but I would like a change of scenery. I have previous experience with python so I have been looking at using Django or Pylons. Many people have wasted time on debating the merits of various framework for weeks before choosing one. I will have chosen a framework by this time tomorrow. 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Thu, 15 Apr 2010 06:32:00 -0700 Capistrano: use git repository on the same server you deploy to http://epochwolf.com/capistrano-use-git-repository-on-the-same-ser http://epochwolf.com/capistrano-use-git-repository-on-the-same-ser

I ran across an interesting problem the other night. I finally convinced myself that I need to set up automated deployment for a personal website I was working on. The website is written in Ruby on Rails and I decided to use capistrano for deployment like ever other person I know that uses rails. The first problem I had was the capistrano docs are really really lacking in details. The tutorial covers the basics but that only works if you aren't doing something wacky.

 

I'm using git for version control which isn't all that odd. What is odd is that I don't have a remote repository. I don't really need to because I backup my laptop almost every night.  I don't want capistrano to use the copy method for deployment because I don't want to be trying to push several hundred kilobytes of data over a coffee shop's overloaded public wifi for every deployment.

 

I didn't want to use a git host like github or any one of a hundred others because I already rent a Virtual Private Server from slicehost.com. (256 slice to be specific) So I decided to just use git over ssh and store a copy of my repository on my server. It was pretty easy to create an empty repository on my server and push my local copy over. Capistrano however did not like this. My website needed to deploy to the same sever my remote repository was sitting on. There is no tutorial or examples for doing this. I googled for over an hour and read all the docs on capistrano.

 

The problem with capistrano is that by default the :repository variable only paths to urls or files on your local machine. I couldn't find a way to tell capistrano to look on the deployment server for the repository.

 

The solution:

set :repository, "file:///srv/git/repository.git"set :local_repository, "file://."

The above works because setting undocumented variable :local_repository tells capistrano that :repository is a location on the app server. Suddenly, I'm able to deploy using export instead of copy. I hope I saved someone else hours of searching to figure out how to do this.

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Thu, 18 Feb 2010 11:35:02 -0800 Shady Url http://epochwolf.com/shady-url http://epochwolf.com/shady-url

The best url "shortner" I've ever seen. Just check out the author's blog post on this. 

http://5z8.info/racist-raps_b1f0_illegal-guns-for-sale

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Fri, 12 Feb 2010 13:22:17 -0800 Singleforest: Registration with OpenID http://epochwolf.com/singleforest-registration-with-openid http://epochwolf.com/singleforest-registration-with-openid Another screenshot from my development version of Singleforest.com. This is the sign up process.

Registration

And once you sign in.

Choose_your_name

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Wed, 03 Feb 2010 22:37:00 -0800 Singleforest: screenshot http://epochwolf.com/singleforestcom-screenshot http://epochwolf.com/singleforestcom-screenshot

After 2 days of really hard work, I've gotten comments working on both literature and the forums. It would have been easier if ruby on rails didn't have such a bungled acts_as_tree implementation. I was forced to use awesome_nested_set to implement a sane scheme for loading threaded comments. I figured it was better to use a decent plugin that I could drop later if I needed to than spend a week to write a better version of acts_as_tree now. (Nested set plugins have a rather nasty O(n) update scheme) As a result I can load an entire forum thread with only 3 queries.


Enjoy the screenshot. (The website is probably 1-2 months 2-4 years* out from public beta tests)

Screenshot_03

*Rule of estimates: double and increase by one order of magnitude. (Months = Years, Years = Decades)

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf
Mon, 18 Jan 2010 20:28:00 -0800 Using BlueCloth 2.0 http://epochwolf.com/using-bluecloth-20 http://epochwolf.com/using-bluecloth-20

This is a quick reference for how to use the BlueCloth 2.0 gem. I couldn't find anything anywhere on how to use this gem so I used irb and the C source of the plugin to figure it out.

Require the gem in a generic ruby project.

require 'rubygems'  #needed to load gems.
gem 'bluecloth', '>= 2.0.0'  #need to specify we want the 2.0 version, not the 1.0 version.
require 'bluecloth'

If you are using Ruby on Rails just add the line below to your environment file.

config.gem 'bluecloth', :version => '>= 2.0.0'

Once you have the gem included you can make a wrapper function

def markdown_parse(str)
  bc = BlueCloth.new(str)
  bc.to_html
end

or a one-liner

html = BlueCloth.new(str).to_html()

If you want to get more complicated and change the default options.

def markdown_parse(str, options={})
  options = {
    :escape_html => true,
    :strict_mode => false,
  }.update(options)
  bc = BlueCloth.new(str, options)
  bc.to_html
end

A full list of options supported by BlueCloth 2.0.5 is below. Be sure to read the notes, some of them are important. You need to be using an html sanitizer with BlueCloth (such as rgrove's sanitize) if you allow user-submitted html to be used with markdown.

 

:remove_links => false

Disable links in markdown. This will ignore the link syntax and break a tags in an unsafe manner. Recommend using a sanitizer instead.

WARNING test(This isn't displaying correctly because of a posterous bug) is converted to <p>&lt;a href="testing">test</a></p>which leaves a trailing </a> which is unsafe. It's not dangerous but it could break the html on your site. It might also be possible to slip a tag past this using unicode or other tricks which is why I recommend using a sanitizer instead of this option.

 

:remove_images => false

Disable images in markdown. This will ignore the link syntax and break image tags naively using the same method as above. Recommend using a sanitizer instead.

 

:smartypants => true

Enable smartypants with markdown

 

:pseudoprotocols => false

Allow url syntax to create named anchors using id: and styled span tags using class:. Unsafe, allows duplicate ids in h tags. Html spec requires ids to be unique.

[just as he said](id:foo) converts to just as he said 
[just as he said](class:foo) converts to <span class="foo">just as he said</span>


:pandoc_headers => false

Enable Discount extension named "pandoc_headers

This the unit test for this feature, I've never used it myself.

it "correctly applies the :pandoc_headers option" do
  input = "% title\n% author1, author2\n% date\n\nStuff."
  bc = BlueCloth.new( input, :pandoc_headers => true )
  bc.header.should == {
    :title => 'title',
    :author => 'author1, author2',
    :date => 'date'
  }
  bc.to_html.should == '<p>Stuff.</p>'
end

 

:header_labels => false

Auto generate ids for h tags. Unsafe, allows duplicate ids in h tags. Html spec requires ids to be unique.

# A header
Some stuff

## A header
More stuff.

is converted to

<h1 id="A+header">A header</h1>
<p>Some stuff</p>
<h2 id="A+header">A header</h2>
<p>More stuff.</p>

 

:escape_html => false

Escape any html the parser finds. Given how naive the html escaping is in :remove_links I would recommend using a sanitizer on top of this.

 

:strict_mode => true

When on, it follows the markdown spec strictly allowing the use of intraword emphasis. (T*hi*s converts to This) When off, intraword emphasis are disabled and a subscript notation is added. I recommend setting this to false because intraword emphasis is annoying.

 

:auto_links => false

Convert bare urls in text into clickable links.

 

:safe_links => false

Only allow links that have recognized protocols to be parsed. Turning this on prevents relative urls from working. I recommend leaving this off and using a sanitizer instead.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/955782/bc_wolf_raspberry.png http://posterous.com/users/3sDGzB3vceFb Epoch Wolf Epochwolf Epoch Wolf