May 2009
1 post
1 tag
Rails and nested has_many :through
Rails does not support nested has_many :though => associations. There is a plugin however which enables this, and JackDangers branch on github has patches for Rails 2.3.2.
script/plugin install git://github.com/JackDanger/nested_has_many_through.git
Which enables you to do the something like the following:
class User < ActiveRecord::Base
has_many :accounts
has_many :memberships, ...
April 2009
5 posts
2 tags
Github issue tracker →
Github have built an awsome issue tracker which is perfect for OS and internal projects, with keyboard shortcuts, a la gmail!
4 tags
Passenger now runs on Nginx →
There is no longer any excuse not to use passenger
1 tag
Ruby Refactoring for your loved editor →
1 tag
Mire is a simple MUD written in Clojure →
Get a sneak peek at the next peepcode vid about clojure
1 tag
Designing to Sell →
March 2009
11 posts
4 tags
Demo app for Twitter OAuth using sinatra and... →
Check out the live demo at http://sinitter.moocode.com/
1 tag
Flash messages hanging around?
If you are making use of the Rails flash helper to display messages, what do you do when they are not clearing after rendering a page? You need to use Flash.now see the following gist for an example.
1 tag
CouchDB Book →
3 tags
Yet another twitter app idea
Planning on checking out tweetapp at some point to build a nifty twitter application on Google App Engine. This should give me a chance to brush off the cobwebs off my python book, although I will praise the day they allow us to use Ruby.
1 tag
Using Google AppEngine for a Little... →
The best UNIX commands on the web →
(via bambinos)
follow @commandlinefu10 for the best tips in your twitter feed
1 tag
Git/Github survival guide →
1 tag
Rails Searchable API Doc →
1 tag
Feature Injection and handling technical stories →
1 tag
Symbol#to_proc's hot cousin. Simple and elegant... →
2 tags
SproutCore, Mochiweb and Mnesia →
January 2009
2 posts
1 tag
Include custom actions from a module in a Merb...
module Foo def self.included(base) base.show_action(:custom_action) end def custom_action "foo" end end
2 tags
Git SHA1 of HEAD in your Rails/Merb App →
November 2008
2 posts
1 tag
Build a bug tracker in 5 mins
bambinos:
Go to google docs, click new spread sheet
Click form, create your form with title, description, severity (1 minor .. 5 epic fail), who’s responsible in a dropdown and reported by.
Save your form
Add conditional colouring on severity
Add a completed/status column
Embed form onto a page/email form to bug hunters.
1 tag
Updating a merb application to 1 point oh!
Having a number of merb applications pre 0.9, here are a number of things to consider while updating your app:
merb-gen core . (to generate the config files, plz have a backup)
update your routes files to have the correct syntax
form’s now require the following (note the closings end =)
<%= form_for @thing, :action => resource(:things) do %> <% end =%>
form...
October 2008
2 posts
1 tag
Deleting Duplicates with Unique Keys in MySQL with...
bambinos:
Trying to delete duplicate data is a pain. Especially when your table is bigger than your RAM available so you cannot just create a temp table can copy the unique rows back and forth.
So I’ve made available some code in this gist which will delete duplicate data, in the case where the ids are unique but the data is duplicated.
# USE: delete_dups_for(Comment, :post_id)
NB: code is at...
1 tag
Scrumy →
Is a cool SCRUM planner. Velociraptor, a velocity tracker and scrum planning app I was building will go into the someday bin after looking at this cool app, as it does most of the things I wanted to build :(
May 2008
1 post
1 tag
json parser for erlang →
April 2008
11 posts
1 tag
Hadoop + EC2 →
2 tags
I have the power
Ruby:
square = lambda {|x| puts x ** 2} power = lambda {|x, y| puts x ** y}
square.call(2) # => 4 power.call(2, 4) # => 16
Erlang:
-module(power). -compile(export_all). sqaure(X) -> X * X. pow(X, 0) -> 1; pow(X, Y) -> X * pow(X, Y-1). geometric_pow(_, 0, Acc) -> Acc; % It’s interesting that if 1 and 2 aren’t “unrolled”, % the linear implementation beats geometric_pow. ...
2 tags
Animals
In Ruby:
class Animal def self.speak "Grunt" end end class Cat < Animal def self.speak "Meeaow" end end class Dog < Animal def self.speak "Ruuf" end end
In Erlang
-module(animals). -export([speak/1]). -export([speak/0]). speak() -> "Grunt". speak(cat) -> "Meeaow"; speak(dog) -> "Ruuf".
export defines the function and it’s arity.
Ruby:
...
1 tag
parallel map erlang →
1 tag
bank in erlang →
ruby-erlang →
omfg… i think i just wet myself
1 tag
http://github.com/jashkenas/ruby-processing/tree/ma... →
freaking awesome
1 tag
http://www.planeterlang.org/ →
1 tag
Collaborative Filtering: Weighted Slope One in... →
1 tag
pareval erlang →
1 tag
Parsing Text/Bin Files with Erlang →
March 2008
5 posts
1 tag
Erlang MapReduce →
1 tag
wireshark →
Wireshark is the world’s foremost network protocol analyzer, and is the de facto (and often de jure) standard across many industries and educational institutions.
1 tag
1 tag
1 tag
Terracotta & JRuby →
Need to try and run merb + jruby + terracotta
February 2008
1 post
1 tag
January 2008
1 post
1 tag
November 2007
8 posts
1 tag
DataMapper →
1 tag
Classy web-development dressed in a DSL
– Sinatra
2 tags
Faster, Lighter, More Agile.
– http://merbivore.com/
UltraSphinx →
1 tag
Self-referential has_many :through associations →
2 tags
“NGINX CONFIG LIKE WHOA” →
1 tag
Aspect-oriented programming and security →
Aspect-oriented programming (AOP) is a paradigm that is quickly gaining traction in the development world. At least partially spurred by the popularity of the Java Spring framework [1], people are beginning to understand the substantial benefits that AOP brings to development. While several others have tied AOP to security [2][3], I aspire to raise awareness amongst my information security...
The playing field has been evened, and no one wins. Except Google. They always...
– Facebook: “We Have Not Been Briefed On OpenSocial”