Ruby On Bindings on caller

by Tj Holowaychuk, November 22, 2008 15:48

Cool thanks! not overly pra...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
def test(a, b)
  capitalize_args
  puts a   # => Hello
...

Ruby Bindings on caller

by Tj Holowaychuk, November 22, 2008 06:16, 2 refactorings, tagged with binding

I dont really have a need f...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
def monitor(uri)
  Thread.new(uri) do |uri|
    begin
...

Ruby Initial script execution ve...

by Tj Holowaychuk, November 22, 2008 02:27, No refactoring

Below is a little snippit o...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
  NAME:
  
...

Ruby suppress ERB newlines

by Tj Holowaychuk, November 22, 2008 02:16, No refactoring, tagged with erb

Just plain-jane ERB. What d...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
require 'uri'

module URI
...

Ruby On Shortest regular expression...

by Tj Holowaychuk, November 21, 2008 07:53 Star_full

I would maybe consider exte...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
require File.dirname(__FILE__) + '/memcached'

class Object
...

Ruby On Caching Methods

by Tj Holowaychuk, November 19, 2008 18:11

Added transparent hard cach...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
class Object
  
  def self.cache_method(method, options = {})
...

Ruby On Caching Methods

by Tj Holowaychuk, November 19, 2008 17:29

Heres what I have so far

F1e3ab214a976a39cfd713bc93deb10f Talk

Ruby On Caching Methods

by Tj Holowaychuk, November 19, 2008 17:04

Heres a stupid question. Ho...

F1e3ab214a976a39cfd713bc93deb10f Talk

Ruby On Caching Methods

by Tj Holowaychuk, November 19, 2008 16:55

Great thanks for the great ...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
class Something
  
...

Ruby Caching Methods

by Tj Holowaychuk, November 19, 2008 05:23, 6 refactorings, tagged with cache

Is it possible to cache met...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
# Suppose I have San::Languages::JavaScript as the 'lang' local var below
# I want a string of 'JavaScript' from this example
...

Ruby Retrieve class name only

by Tj Holowaychuk, November 07, 2008 04:41, 1 refactoring

Im sure there is a better w...

F1e3ab214a976a39cfd713bc93deb10f Talk

Ruby On Yield by 'reference'

by Tj Holowaychuk, October 24, 2008 18:31

Hmm well that makes sense a...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
def something(var)
  var = 'world'
end
...

Ruby On Yield by 'reference'

by Tj Holowaychuk, October 24, 2008 16:21

Strange.. must just have my...

F1e3ab214a976a39cfd713bc93deb10f Talk

Ruby On Yield by 'reference'

by Tj Holowaychuk, October 24, 2008 16:12

So my code above just flat ...

F1e3ab214a976a39cfd713bc93deb10f Talk

Ruby On Yield by 'reference'

by Tj Holowaychuk, October 24, 2008 15:55

and the bottom call to each...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
def some_method(var, &block)
   yield var
 end
...

Ruby On Yield by 'reference'

by Tj Holowaychuk, October 24, 2008 15:52

I understand that now, but ...

F1e3ab214a976a39cfd713bc93deb10f Talk

Ruby On Yield by 'reference'

by Tj Holowaychuk, October 24, 2008 02:30

Aware of that now :) makes ...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
class Array
  def inject(accumulator = 0)
    each { |element| yield(accumulator, element) }
...

Ruby On Yield by 'reference'

by Tj Holowaychuk, October 24, 2008 01:58

Hmm i understand that, Im s...

F1e3ab214a976a39cfd713bc93deb10f Talk

Ruby On Yield by 'reference'

by Tj Holowaychuk, October 24, 2008 01:36

It is interesting that the ...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
res = path_without_calculation.scan(/\{([^}]+)\}/).flatten

Ruby On Extract text between {} bra...

by Tj Holowaychuk, October 23, 2008 22:48

This is maybe a little nit-...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
class Array
  def new_inject(initial, &block)
    self.each { |v| yield initial, v } 
...

Ruby Yield by 'reference'

by Tj Holowaychuk, October 23, 2008 22:25, 16 refactorings

This has been bugging me, i...

F1e3ab214a976a39cfd713bc93deb10f Talk

Ruby On Camelize

by Tj Holowaychuk, September 30, 2008 15:11

Just learning :) thanks guy...

F1e3ab214a976a39cfd713bc93deb10f Talk

Ruby On Source code analysis

by Tj Holowaychuk, September 26, 2008 22:58

I am skipping rails for now...

F1e3ab214a976a39cfd713bc93deb10f Talk

Ruby On Source code analysis

by Tj Holowaychuk, September 26, 2008 03:05

Yikes, not sure what is up ...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
#!/usr/bin/env ruby

# == Synopsis
...

Ruby Source code analysis

by Tj Holowaychuk, September 26, 2008 03:04, 3 refactorings

Small class to analyze scri...

F1e3ab214a976a39cfd713bc93deb10f Talk