I’ve been using ActsAsSolr for about 6 months.
And at work I developed some code to make SOLR queries work a bit like the conditions in ActiveRecord.
Check out my library at Github. http://github.com/matthewrudy/solr_query
SolrQuery.build(:keyword => "Feather duster"
=> "feather duster"
SolrQuery.build(:keyword => "clean",
:organisation => [organisation1, organisation2])
=> "clean AND organisation:(275 OR 6534)"
Wicked!
Check out the readme for more examples.
We just moved to new Ubuntu servers.
We use file-column (with some modifications) to deal with our file uploads.
deploy@jgp-web01:/var/www/oursite$ ls -l public/uploaded_file/file_name/000/000/051/585/
total 4
-rw-r--r-- 1 gerhard www-data 2670 2008-11-15 05:09 MatthewJacobsCV.txt
deploy@jgp-web02:/var/www/oursite$ ls -l public/uploaded_file/file_name/000/000/051/585/
total 4
-rw-r--r-- 1 deploy www-data 2670 2008-11-15 05:09 MatthewJacobsCV.txt
If you look carefully, you’ll see one is owned by “deploy” and the other by “gerhard”.
These are mounted by NFS, shared across the two computers.
So these are actually the same file, but with different permissions on each.
A quick use of the “id” command confirmed this;
deploy@jgp-web01:~$ id deploy
uid=1004(deploy) gid=33(www-data) groups=33(www-data),1005(aspire)
deploy@jgp-web02:~$ id deploy
uid=1002(deploy) gid=33(www-data) groups=33(www-data),1003(aspire)
The answer is;
root@jgp-web01:~# usermod -u 10000 deploy
root@jgp-web02:~# usermod -u 10000 deploy
boom!
Now this is resolved, but you’ll have to chown all the existing files, back to `deploy`, else they’ll still be attached to the old uid.
svn switch —relocate svn://oldserver svn+ssh://newserver
need to move your svn repository?
A recent post on the Google App Engine blog refers to;
“Support for a new runtime language”
That’s got to be ruby…
Imagine a bespoke Sinatra-style minimal framework, with DataMapper bindings to the Google DataStore.
No doubt it’ll be pretty quick to make it work with Merb as well.
AWESOME.
Why did google never reply to my job application asking to work on it?
(if you haven’t seen the videos from last years Google IO, then they’re well worth watching - here)
At work we have the following concept.
- a “site” has a subset of our content
- a “site” has a url - eg. “oursite.com/stickers” or “stickersNOTvicars.com”
- a “site” can have its own customised layout, or fall back to the default one
How does this work in code?
- site.articles (pretty simple)
- a whole load of “route filters” that match the incoming host
- the code I’m writing about
So, historically we did
class ApplicationController
layout :determine_layout
def determine_layout
if File.exists?("#{Rails.root}/public/sites/#{@site.id}/application.rhtml")
"../../public/sites/#{@site.id}/application"
else
"site_default"
end
end
end
This was a hack, and it breaks with Rails 2.1.1, so after a day or so playing with the internals of ActionView I discovered this;
append_view_path("#{Rails.root}/public/sites")
And it works!
We just need to set;
"#{@site.id}/application"
as our layout, and we’re away.
Site-specific layouts that live in /public!
I didn’t get drunk enough to try the Goggles. Next time!