Bambinos RSS

New Bamboo

Bamboo Blog

Archive

Jun
19th
Fri
permalink maxthelion
1337 github mod for new iphone
1337 github mod for new iphone
Jun
7th
Sun
permalink bartoszblimke

Is beanstalkd really distributed?

I recently needed to understand how beanstalkd works and how does it implement the distributed behaviour, so I did some reading.

From the beanstalkd main page:

beanstalkd is a fast, distributed, in-memory workqueue service

Ok, it is a distributed service, so let’s find some more info about its distributed nature.

This is what we can find in beanstalkd FAQ:

Does beanstalk inherently support distributed servers?
Yes, although this is handled by the clients, just as with memcached. The beanstalkd server doesn’t know anything about other beanstalkd instances that are running.

Using the same argumentation I could say that FTP or any database server is also distributed if you only start more than one instance. The fact some server allows to create scalable and distributed solutions, doesn’t necessarily mean that they are distributed on their own.

May
16th
Sat
permalink paulbjensen

Run Apple's QuickTime Player from the terminal

open -a “QuickTime Player” VIDEO_FILE
May
15th
Fri
permalink dctanner
Apr
3rd
Fri
permalink ollylegg
Mar
26th
Thu
permalink paulbjensen

How to run the Haml plugin generator in Rails Templates

Here is how to run Haml’s unorthodox plugin generator method using Rails Templates:

Here is a sample Rails Template for fun:

permalink dctanner
Mar
11th
Wed
permalink maxthelion

Freudian slip during copywriting

The alternative, and traditional method of ruinning software projects is called “waterfall”
Feb
25th
Wed
permalink dctanner
Jan
23rd
Fri
permalink matthewcford

Include custom actions from a module in a Merb controller

module Foo
  def self.included(base)
    base.show_action(:custom_action)
  end
  
  def custom_action
    "foo"
  end
end


Jan
19th
Mon
permalink matthewcford
Jan
16th
Fri
permalink bartoszblimke

Delete all removed files from git

git add -u
This deletes all removed files from git.
Dec
8th
Mon
permalink ismasan

Skinny controllers with resources_controller and named_scope

resources_controller takes you a long way into simplifying your controllers. Still, whenever you need to add custom collection or member routes to your app you’re out in the wild again. This snippet of code uses a combination of ActiveRecord’s named_scopes and resources_controller to simplify those custom actions. With a bit more of abtraction it could be turned into library code that you test once and reuse as many times as you want in different codebases.

The cool thing is that we get seamless nested controllers if we need them, such as in /posts or /users/2/posts

Nov
25th
Tue
permalink ismasan

Convention for ActiveRecord extensions

There’s not one but many ways of extending ActiveRecord. Some people do:

ActiveRecord::Base.send :include SomeModule

Which in turns includes or extends other modules.

Others extend first, and include internally. Others class_eval the hell out of everything.

There are a few gotchas to avoid, such as accidentally reloading the same modules (ie. in background tasks), which can cause havoc if your extensions uses method aliasing.

Looking at different approaches, I’ve come up with this draft of a convention. 

Here’s the gist of it.

Nov
19th
Wed
permalink dctanner