1
2
3
4
# This is what an application build with our framework would look like.
# Run with:
#   rackup app.ru
...

Ruby Very Simple Rack framework

by macournoyer, September 14, 2008 18:11, 1 refactoring, tagged with rack

I'll be presenting http://r...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk

Ruby On Ruby Custom Sort

by macournoyer, August 04, 2008 14:38

You can edit your entry usi...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
1
v = (a[:k][0] rescue nil) || 1

Ruby On Assignment from array

by macournoyer, July 22, 2008 20:58
Bfec5f7d1a4aaafc5a2451be8c42d26a Talk

Bash On kill nginx master proces

by macournoyer, June 27, 2008 19:59

Not sure it's a good idea, ...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
1
sudo kill -INT `cat /usr/local/nginx/logs/nginx.pid`

Bash On kill nginx master proces

by macournoyer, June 27, 2008 17:13

Replace /usr/local/nginx/ w...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
1
2
3
4
module StringReader   
  def string_reader(*params)
    params.each do |param|
...

Ruby On Refactor "class <&l...

by macournoyer, June 03, 2008 14:58 Star_fullStar_fullStar_fullStar_fullStar_full

I think this makes the code...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk

C# On Since I Cannot Message Peop...

by macournoyer, March 31, 2008 11:25

hey Rob, why not post some ...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk

Ruby On Including modules degradably

by macournoyer, February 13, 2008 02:05

Seems like there was a cach...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk

Ruby On Rubyize this : 5th edition

by macournoyer, January 03, 2008 14:41

Sorry about the form not wo...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
1
2
3
4
def highlight_text(input, words_to_highlight=%w(important monkey dancing))
  input.gsub(/#{words_to_highlight.join('|')}/i, '*\0*')
end
...

Ruby On Rubyize this : 5th edition

by macournoyer, January 03, 2008 14:26

Here's my take, it's short ...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
1
2
3
4
class FizzBuzz
class << self
	attr_accessor :_fizzbuzz_trans_keys
...

Ruby On Challenge: Ugliest Ruby Fiz...

by macournoyer, December 20, 2007 23:48 Star_fullStar_fullStar_fullStar_fullStar_full

Mine is more rubust

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk

JavaScript On Amélioration d'une fonction JS

by macournoyer, December 01, 2007 20:27

Sorry Eineki about the prob...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk

Ruby On managable test method

by macournoyer, November 23, 2007 15:15

might be easier for you to ...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk

Ruby On managable test method

by macournoyer, November 22, 2007 18:41 Star_fullStar_fullStar_fullStar_full

You should give a look at R...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk

Ruby On fragment cache

by macournoyer, November 22, 2007 18:38

Why not used action caching...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk

Ruby On Random number generator

by macournoyer, November 19, 2007 19:57

Here's a fun intro to Ruby ...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk

Ruby On Random number generator

by macournoyer, November 19, 2007 18:09

sorry I forgot to put the p...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
1
ruby -e "puts (1..500).map {rand(10 ** 16).to_s.rjust(16,'0')}"

Ruby On Random number generator

by macournoyer, November 19, 2007 15:14

You can open an interactive...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk

Ruby On Handling nil object

by macournoyer, November 16, 2007 20:06

indeed, very cool Jeremy, t...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
1
<%= [@post.category.name if @post.category, link_to(@post.title, post_path(@post))].compact.join(' : ') %>

Ruby On Handling nil object

by macournoyer, November 16, 2007 19:24

thx for the replies

I like...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
1
<%= (@post.category ? @post.category.name : '') + ' ' + link_to(@post.title, post_path(@post)) %>

Ruby Handling nil object

by macournoyer, November 14, 2007 02:07, 13 refactorings, tagged with rails, html

@post.category can be nil, ...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
1
2
3
class PostsController < ApplicationController
...

Ruby On resource_controller: Redesi...

by macournoyer, November 05, 2007 22:24 Star_fullStar_fullStar_fullStar_full

A couple of suggestions. I'...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
1
2
3
4
class String 
  def postal?  
    self =~ /[a-z]\d[a-z]([\s-])*\d[a-z]\d/i
...

Ruby On Is This String Postal?

by macournoyer, October 30, 2007 15:53 Star_fullStar_fullStar_fullStar_full

I think {1} are useless, we...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
1
2
3
4
function sum(a, b) {
  return a + b;
}
...

JavaScript On Curry

by macournoyer, October 30, 2007 15:48

Prototype 1.6 is gonna supp...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
1
2
3
4
class String
  def to_proc
    eval "proc { |s| s#{self} }"
...

Ruby On String#to_proc (by Reginald...

by macournoyer, October 30, 2007 14:24 Star_fullStar_fullStar_fullStar_full

I refactored it for the sim...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk