Ruby On Interactive CLI Session

by chrismo, September 23, 2008 21:06

I did something similar-ish...

8fb47582197b2d50cd7d297841c8cc87 Talk

Ruby On Code to detect the web browser

by chrismo, August 29, 2008 04:09

well, that's what I get for...

8fb47582197b2d50cd7d297841c8cc87 Talk
1
2
3
def test_web_browser()
  request.env["HTTP_USER_AGENT"].gsub(/\W/, '')
end

Ruby On Code to detect the web browser

by chrismo, August 29, 2008 01:46

Whoops - shorter regexp. I ...

8fb47582197b2d50cd7d297841c8cc87 Talk
1
2
3
4
def test_web_browser()
  return translate_user_agent(request.env["HTTP_USER_AGENT"])
end
...

Ruby On Code to detect the web browser

by chrismo, August 29, 2008 01:43

Here's a more thorough vers...

8fb47582197b2d50cd7d297841c8cc87 Talk
1
2
3
def test_web_browser()
  request.env["HTTP_USER_AGENT"].gsub(/[^A-Za-z0-9]/, '')
end

Ruby On Code to detect the web browser

by chrismo, August 29, 2008 01:42

I submitted this earlier, b...

8fb47582197b2d50cd7d297841c8cc87 Talk
1
2
3
def test_web_browser()
  return request.env['HTTP_USER_AGENT'].gsub(/\/| /, '')
end

Ruby On Code to detect the web browser

by chrismo, August 28, 2008 17:38

Something like this would d...

8fb47582197b2d50cd7d297841c8cc87 Talk

Ruby On simplify multiple gsub

by chrismo, August 27, 2008 21:21

Thanks, John - I knew I was...

8fb47582197b2d50cd7d297841c8cc87 Talk

Ruby On simplify multiple gsub

by chrismo, August 27, 2008 03:41

Probably then just a versio...

8fb47582197b2d50cd7d297841c8cc87 Talk
1
2
3
4
def process_orig(data)
  data = data.gsub("\xA0", " ")
  data = data.gsub("\x99", "(TM)")
...

Ruby On simplify multiple gsub

by chrismo, August 27, 2008 03:40

I took a stab at 'optimizin...

8fb47582197b2d50cd7d297841c8cc87 Talk
1
2
3
return if @events.nil? || @recurrents.nil?

@events.each do ...

Ruby On superfluous if statements

by chrismo, August 11, 2008 01:30

You could start the method ...

8fb47582197b2d50cd7d297841c8cc87 Talk