You are here: Blogsphere Longtail
Keep up to date with your favourite Rails bloggers in context.
Why I'm on Aptana instead of Netbeans
Such a small thing, but it impacts every moment spent with code: the speed of the as-you-type file lookup/open.
Sadly (for Netbeans and those of us who would like to take advantage of its manifest goodness) it's as simple as that.
We've been in Austin, TX for a week and now got back home. But my heart is still crawling somewhere along Brazos and the Sixth streets. I never expected I'd like Texas so much. There was first trip to America, Eugenia was there last year, in New York. But seems she's amazed by Texas as much as me. We've got a lot of photos of beautiful Austin, you can view then on my flickr account and Eugenia's one too. I'd like to put here the one I love the most:
Hey everyone!
It’s been a long a time since our last post, but in the past few months we’ve been incredibly busy working on a few projects: both for ourselves and for our clients. Of course, we love being busy and don’t complain about it, but we had to put the blog on hold.
However, the idea right [...]
TextMate 1.99
Trevor Squires has released a brilliant bundle for TextMate that uses the Ack tool to provide the kind of search in project feature that TextMate has been sorely lacking for... oh I don't know about 2.5 years now.
Ack is described as
a tool like grep, aimed at programmers with large trees of heterogeneous source code.
and the TM bundle means you have, bound to Cmd+Shift+A, a fast search in project that will also (and how long have I wanted this??) restrict searches to the part of the project tree you have selected.
Fox7’s Randy Moore or Captain Kangaroo? You decide
stats_command_string = on
stats_start_collector = on # needed for block or row stats
# /sbin/service postgresql restart
, и в консоли постгреса смотреть статистику:
postgres=# select * from pg_stat_activity;

Sunday June 1st, 2008 at 2pm
Talk starts at 2:30pm
Tea, coffee and treats will be served
Limited Seating and Goodie Bags, please RSVP to reserve a spot
Copies of the book will be available for purchase at the event
We LOVE The Cross. Not only are their home treasures gorgeous (Carrie worked with them a lot when she was doing Interior Design,) Stephanie and the entire Cross team are lovely. The energy in that store makes you want to pour some tea, pen some thank you notes, and chat about happenings in Paris.
See you for Sunday tea and talk on June 1st! xo Carrie & Danielle
Gas is $4. Memorial Day travel is cancelled.
<lj-embed id="1" />
Making a good choice when using Flex components
An update on the happenings at Alhambra Theater

who knew?
via img.skitch.com
(posted by ali)
Perhaps I have misjudged the number of people who want a 3’ x 5’ flag of their logo.
Up to #12 overall on cakefinancial.com. My gamble on AAPL may carry me into the top ten today.
There we go, Cloggers
<link href="/stylesheets/ruby.css?1191685535" rel="Stylesheet" type="text/css" media="screen" />class Percentage attr_reader :amount def initialize(amount) @amount = amount end def of(number) number * (amount / 100.0) end end class Numeric def percent Percentage.new(self) end end 25.percent.of 16 # => 4.0 18.percent.of 321 # => 57.78
“ It’s the defeat of death. ”
Marvin Minsky on the goal of AI
fragment_cache.rb
module ActsAsCached
module FragmentCache
def self.setup!
class << CACHE
include Extensions
end
setup_fragment_cache_cache
setup_rails_for_memcache_fragments
setup_rails_for_action_cache_options
end
# add :ttl option to cache helper and set cache store memcache object
def self.setup_rails_for_memcache_fragments
if ::ActionView.const_defined?(:Template)
# Rails 2.1+
::ActionController::Base.cache_store = CACHE
else
# Rails < svn r8619
::ActionView::Helpers::CacheHelper.class_eval do
def cache(name = {}, options = nil, &block)
@controller.cache_erb_fragment(block, name, options)
end
end
::ActionController::Base.fragment_cache_store = CACHE
end
end
def self.setup_fragment_cache_cache
Object.const_set(:FragmentCacheCache, Class.new { acts_as_cached :store => CACHE })
end
# add :ttl option to caches_action on the per action level by passing in a hash instead of an array
#
# Examples:
# caches_action :index # will use the default ttl from your memcache.yml, or 25 minutes
# caches_action :index => { :ttl => 5.minutes } # cache index action with 5 minute ttl
# caches_action :page, :feed, :index => { :ttl => 2.hours } # cache index action with 2 hours ttl, all others use default
#
def self.setup_rails_for_action_cache_options
::ActionController::Caching::Actions::ActionCacheFilter.class_eval do
# convert all actions into a hash keyed by action named, with a value of a ttl hash (to match other cache APIs)
def initialize(*actions, &block)
if [].respond_to?(:extract_options!)
#edge
@options = actions.extract_options!
@actions = actions.inject(@options.except(:cache_path)) do |hsh, action|
action.is_a?(Hash) ? hsh.merge(action) : hsh.merge(action => { :ttl => nil })
end
@options.slice!(:cache_path)
else
#1.2.5
@actions = actions.inject({}) do |hsh, action|
action.is_a?(Hash) ? hsh.merge(action) : hsh.merge(action => { :ttl => nil })
end
end
end
# override to skip caching/rendering on evaluated if option
def before(controller)
return unless @actions.include?(controller.action_name.intern)
# maintaining edge and 1.2.x compatibility with this branch
# Jan Prill - added && false
#if @options && false
# DSS - removed false - false causing else to always run - this may be
# because Jan was using Rails 1.2...
if @options
action_cache_path = ActionController::Caching::Actions::ActionCachePath.new(controller, path_options_for(controller, @options))
else
action_cache_path = ActionController::Caching::Actions::ActionCachePath.new(controller)
end
# should probably be like ActiveRecord::Validations.evaluate_condition. color me lazy.
if conditional = @actions[controller.action_name.intern][:if]
conditional = conditional.respond_to?(:call) ? conditional.call(controller) : controller.send(conditional)
end
# Jan Prill - causing caching to stop after a period of time?
#@actions.delete(controller.action_name.intern) if conditional == false
# Jan Prill - added if clause
cache = controller.read_fragment(action_cache_path.path) if conditional != false
if cache && (conditional || conditional.nil?)
controller.rendered_action_cache = true
if method(:set_content_type!).arity == 2
set_content_type!(controller, action_cache_path.extension)
else
set_content_type!(action_cache_path)
end
controller.send(:render, :text => cache)
false
else
# 1.2.x compatibility
# Jan Prill added &&
controller.action_cache_path = action_cache_path if (controller.respond_to?(:action_cache_path) && conditional != false)
end
end
# override to pass along the ttl hash
def after(controller)
# Jan Prill - added || controller.action_cache_path.nil?
return if !@actions.include?(controller.action_name.intern) || controller.rendered_action_cache || controller.action_cache_path.nil?
# 1.2.x compatibility
path = controller.respond_to?(:action_cache_path) ? controller.action_cache_path.path : ActionController::Caching::Actions::ActionCachePath.path_for(controller)
controller.write_fragment(path, controller.response.body, action_ttl(controller))
end
private
def action_ttl(controller)
@actions[controller.action_name.intern]
end
end
end
module Extensions
def read(*args)
return if ActsAsCached.config[:skip_gets]
FragmentCacheCache.cache_store(:get, args.first)
end
def write(name, content, options = {})
ttl = (options.is_a?(Hash) ? options[:ttl] : nil) || ActsAsCached.config[:ttl] || 25.minutes
FragmentCacheCache.cache_store(:set, name, content, ttl)
end
end
module DisabledExtensions
def read(*args) nil end
def write(*args) "" end
end
end
end
Thanks to our friends at LinkedIn, Joyent and Sun, we’re having a hackfest at McMenamins/Kennedy School on Thursday evening, May 29, starting at 6:30pm, complete with food and beverages!
Do stop by and hang out with us! Leave a comment over at Charlie’s announcement if you’re interested in joining us.

Kennedy School
Local: (503) 249-3983
Elsewhere: (888) 249-3983
Rails Chops: RESTFul Authentication
[Wordpress] Pressmark: Bookmarks with Wordpress CMS
Lockdown is a authentication/authorization system for RubyOnRails (ver 2.x). While Merb functionality is in place, it is not complete. There will be a release solely focused on getting the Merb functionality up to par with Rails.
Lockdown is een gem die authenticatie- en authorisatiefunctionaliteit voor zijn rekening kan nemen. In gebruik nemen in een project gaat als volgt:
$ sudo gem install lockdown
$ cd <your_project_directory>
$ lockdown .
Lockdown plaatst vervolgens twee files in de /lib map die onderandere de volgende functionaliteit aan je applicatie toevoegen.
Sessie beheer:
# current_user_is_admin?: returns true if user is assigned
# administrator rights.
Groepen (rollen) beheer:
# current_user_access_in_group?(grp): grp is a symbol referencing a
# Lockdown::UserGroups method such as :registered_users
# Will return true if the session[:access_rights] contain at
# least one match to the access_right list associated to the group
Permissie beheer:
# set_permission(:sessions, all_methods(:sessions))
# set_permission(:my_account, only_methods(:users, :edit, :update, :show))
Al met al een leuke gem om in de gaten te houden!
Uiteraard beschikbaar via RubyForge.
Flash Technology vs. Flash Developer
So I finally got around to installing mod_rails on my dev box (OS X Leopard) and thought I’ld share some things with you.
First of all I’m running a completely standard install, original apache. I know a few of the tutorials out there have you installing a new apache. You don’t need to do this any more. All you need to do is install the gem using
sudo gem install passenger
passenger-install-apache2-module
Once that’s done without error (You will need the developer bundle installed as it compiles a bit of c++) you need to change some apache settings.
Open up /private/etc/apache2/user/yourUserName.conf using your favorite text editor
now inside this file you should have
<Directory "/Users/userName/Sites/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
To this add
<Directory "/Users/userName/Sites/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
LoadModule passenger_module /Library/Ruby/Gems/1.8/gems/passenger-1.0.5/ext/apache2/mod_passenger.so
RailsSpawnServer /Library/Ruby/Gems/1.8/gems/passenger-1.0.5/bin/passenger-spawn-server
RailsRuby /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
NameVirtualHost *:80
<VirtualHost *:80>
ServerName demo.test
DocumentRoot "/Users/userName/Sites/demo/public"
RailsEnv development
<Directory "/Users/userName/Sites/demo/public">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
now this is assuming you have a rails app named “demo” in your Sites directory at ~/Sites.
Now open up /private/etc/hosts
add this line to the bottom and save
127.0.0.1 demo.test demo2.test demo3.test
this will allow you to have rails sites accessible from your browser demo.test demo2.test demo3.test
Basically when you want to add another site fire open your userName.conf file and add another
<VirtualHost *:80>
ServerName demo2.test
DocumentRoot "/Users/userName/Sites/demo/public"
RailsEnv development
<Directory "/Users/userName/Sites/demo/public">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
changing the directory and Servername.
Type
sudo apachectl graceful
Then open up your site
open http://demo.test
and all should be good. If you want to move out of the Sites directory or a directory that isn’t shared and ACL is enabled on your box, please refer here
ACL Issue
via http://www.mentalfloss.com/blogs/archives/15131

Tell us what you think of the new BlogSphere feature. We are continually looking to improve and update the
functionality based on your feedback.

Find your next Ruby on Rails project or job.
Exclusive content,
regularly updated - onsite and tele-working positions listed.
World's best client
-
T.P, United States