I just did the initial commit of the ruby on rails wiki engine I built – here and here for Wiki.Cullect.com – into the collaborative source-code site github. If you’re interested in helping out – or just need a Rails-based Wiki – you can grab it here: http://github.com/garrickvanburen/culwiki/tree/master
Category: Programming
9 Things Cullect Taught Me About Software
Forcing people to create an account to use your software is a bug. if you’re not scared to deploy, you’ve stopped caring. Murphy is alive and well. Google and a bookself of technical books can be equally useless. Good software is like an iceberg. if you ask for money, people will give it to you. […]
How To Cache Highly Dynamic Data in Rails with Memcache – Part 1
There are a number of ways increase Ruby on Rails performance through caching. Caching works because things don’t change….or don’t change frequently. In Cullect, almost everything is dynamic, even Cullect’s HTML presentation format has 3 different states depending on access privileges and there are 8 other presentation formats available. The standard page, action, and fragment […]
How To: Build a Wiki with Ruby on Rails – Part 2
Back in Part 1 of Building a Wiki with Ruby on Rails, we built the core wiki engine. Time to add some syntax formatting. These days, I’m pretty enamored of Haml, it’s more like HTML (unlike many other formatting engines) and it’s fast to write (unlike many other formatting engines). 1. Install Haml Haml installs […]
How To: Build a Wiki with Ruby on Rails – Part 1
Here’s how to build a very simple Ruby on Rails-based wiki engine 1. 1. Create the Rails App rails wiki and cd wiki to get inside the app. Remember: create your database (i.e. wiki_development) and update config/database.ymlappropriately 2. Generate the Scaffolding There are 3 nouns in this wiki system: People, Pages, Revisions. Let’s create the […]
Snippet: Copy MySQL Databases Over SSH
I needed to copy a database and the idea of backing it up just to re-import1 seemed like double the work. Here’s a snippet to pipe a mysqldump into a remote database. Keep an eye on the user names and passwords – you’ll need 3 sets; one for the database your copying, one to get […]
Ruby on Rails Snippet for Changing Relative Paths to Absolute
If you have a bunch of text containing relative path hyperlinks, and you’d like to change to them to absolute paths, you might find this snippet helpful. content = “some text with a <a href=’/path/to/relative_link/’>relative link</a>” link = “http://somedomain.com/” content.gsub(/=(‘|”)//, ‘=1*/’).gsub(/*//, link.match(/(http|https)://[w.]+//)[0]) The asterisk ‘*’ is a hackey placeholder for the actual link swapped in […]
Parsing Arbitrary XML Namespaces in Ruby with Hpricot
(This post inspired by a Ruby.MN conversation) I’ve burned through at least 3 different XML parsing libraries in building Cullect. I started the built-in REXML (pro: built-in, con: heavy and slow) then moved to FeedTools (pro: easily parses the most common feed formats, con: no longer in active development). I have a lot of love […]
Optimization Tips: Ruby on Rails and MySQL
Stop. I’ve uncovered these tips after (at least) the 3rd refactoring effort of some fairly simple, straight-forward Rails code. Rails is great for getting ideas prototyped super fast. These tips will slow down development and make apps less portable. Continue reading only if you’re running a live app in production and not happy with how […]
Restarting Rails with ‘Address Already in Use’
iTerm crashed on my this morning taking down my development Rails process. Now, I’m busy tailing cullect.com‘s production.log and listening to some podcasts so I didn’t want to restart1 A little Googling found John Nunemaker’s year-old, “Oops I did it again” post. His tips worked. An I’m rewriting the following for Future Reference2: $ ps […]