Vim: Find/Replace in projects using ackNovember 30, 2012 |
Since moving to vim from Sublime Text 2 the one thing I have been less than happy with is find and replace in files. This seems to be the accepted solution:
:args app/views/*/*
:argdo %s/search/replace/ge | update
Taylor-RealtorsJanuary 29, 2013 |
Taylor-Realtors is a Montana Real Estate Firm. The site features fast keyword and advanced searching using the Sphinx Engine with Thinking-Sphinx and multiple MLS feeds. One of challenges I faced during development was parsing the many types of files given to us through MLS providers because they don't all use the same format and they only provide images for the last couple days of listings so all the rest
Running php on an ngnix server set up for Rails.December 05, 2012 |
Its super easy to set up a server for php if you're running apache as your default web sever. However, I recently had to figure out the how to run php an Ubuntu server which has been set up for rails using nginx and passenger. One option is to run apache on a different port and then route that through nginx but this method requires a lot of memory. The solution I choose was to use php-fpm.
apt-get install php5-fpm
Combining Word Press with a Rails App using nginx proxy_passJanuary 15, 2013 |
Despite our love for Ruby we sometimes find ourselves with clients who want to keep their Wordpress blog in conjunction with their shiny new Rails app. The most obvious way to do this is to run it on a different subdomain (blog.domain.com), but this presents an SEO problem because your blog which is often one of the most useful tools for attracting people is now on a different domain.
Pygments.rbOctober 30, 2012 |
Here is some useful code for syntax highlighting. Borrowed from Ryan Bates
module ApplicationHelper
class HTMLwithPygments < Redcarpet::Render::HTML
def block_code(code, language)
sha = Digest::SHA1.hexdigest(code)
Rails.cache.fetch ["code", language, sha].join('-') do
Pygments.highlight(code, lexer: language)
end
end
end
def markdown(text)