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
1
2
3
4
namespace :db do
  namespace :migrate do
    desc 'Reverts, renames and re-executes uncommitted migrations that conflict with already committed migrations'
...

Ruby On Rails migration conflict re...

by macournoyer, October 29, 2007 20:57

This is the most useful rak...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk

JavaScript On ImageFlow - something like ...

by macournoyer, October 25, 2007 15:49

WOW! that's some nice effec...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
1
<% @@content_for_layout = "<script>alert('I can do whatever I want here!')</script>" %>

Ruby On Need explaination

by macournoyer, October 25, 2007 15:43

That might be a security ho...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
1
2
3
4
require 'erb'

text = <<-EOS
...

Ruby On Need explaination

by macournoyer, October 25, 2007 02:31

ERB.new last parameter spec...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
1
2
3
4
class Bug < Struct.new(:name, :type, :iq, :annoyance_factor); end

#create some bugs!
...

Ruby On Rubyize this : 4th edition

by macournoyer, October 23, 2007 13:50 Star_fullStar_full

Here's my take. Bug as no l...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk

PHP On Codera Homepage

by macournoyer, October 22, 2007 17:44

hey thelittleninja, I doubt...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk