---
--- Tag
...

Haskell Tag

by Tj Holowaychuk, April 13, 2009 01:03, 3 refactorings, tagged with html tags

Just playing around, super ...

F1e3ab214a976a39cfd713bc93deb10f Talk
describe 'ShoppingCart'
  var cart

...

JavaScript Testing Framework

by Tj Holowaychuk, April 11, 2009 19:26, No refactoring, tagged with test framework jspec

Snippit from http://visionm...

F1e3ab214a976a39cfd713bc93deb10f Talk
class String
  def dasherize
...

Ruby Hash#switchify

by Tj Holowaychuk, April 08, 2009 21:26, 3 refactorings, tagged with ruby, hash, switch

Whipped this up really quic...

F1e3ab214a976a39cfd713bc93deb10f Talk
class String
  def wrap prefix, suffix = nil
    [prefix, self, (suffix || prefix)].join
...

Ruby Simple wrap method

by Tj Holowaychuk, March 20, 2009 18:35, 7 refactorings

rawr

F1e3ab214a976a39cfd713bc93deb10f Talk
/**
 * Create a range string which can be evaluated to a native array.
 *
...

JavaScript Range

by Tj Holowaychuk, March 17, 2009 21:26, 6 refactorings

I use this in a JS interpre...

F1e3ab214a976a39cfd713bc93deb10f Talk
class String
  def strip chars = "\s"
    gsub /^[#{chars}]+|[#{chars}}]+$/, ''
...

Ruby String#strip with char list

by Tj Holowaychuk, February 21, 2009 01:08, 6 refactorings, tagged with string strip

Better way?

F1e3ab214a976a39cfd713bc93deb10f Talk
require 'rubygems'

class Numeric
...

Ruby Time lost since

by Tj Holowaychuk, February 02, 2009 18:34, No refactoring, tagged with time date

Pasted the rest just so peo...

F1e3ab214a976a39cfd713bc93deb10f Talk
var next = false;
for (var i = 0; i < el.options.length; i++) {
  if (next) {
...

JavaScript Check next option in select...

by Dmitry Polushkin, January 25, 2009 15:04, 5 refactorings, tagged with select, options, increment, next

Could be written in plain j...

832ed6ace46d61032151f4e1864c057f Talk
params[:name][:primary] # etc ...

Ruby Recursive population of has...

by Tj Holowaychuk, January 23, 2009 20:13, 11 refactorings

I do not even know where to...

F1e3ab214a976a39cfd713bc93deb10f Talk
include Form::Elements

...

Ruby Closure scoping issue

by Tj Holowaychuk, January 09, 2009 20:14, 5 refactorings, tagged with form

Below is the syntax I would...

F1e3ab214a976a39cfd713bc93deb10f Talk
require 'ostruct'
require 'rubygems'
require 'extlib/blank'
...

Ruby includes_all?

by Tj Holowaychuk, January 05, 2009 21:14, 5 refactorings

Having brain cramps today, ...

F1e3ab214a976a39cfd713bc93deb10f Talk
def run_once &block
  path = File.expand_path caller.first
  unless ($__run_once ||= []).include? path
...

Ruby Run once

by Tj Holowaychuk, December 16, 2008 21:30, 9 refactorings

Cleaner way?

F1e3ab214a976a39cfd713bc93deb10f Talk
# Working example
def test &block
...

Ruby Proc param names

by Tj Holowaychuk, December 12, 2008 23:20, 5 refactorings, tagged with binding

Below is the exact result I...

F1e3ab214a976a39cfd713bc93deb10f Talk
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
def monitor(uri)
  Thread.new(uri) do |uri|
    begin
...

Ruby Initial script execution ve...

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

Below is a little snippit o...

F1e3ab214a976a39cfd713bc93deb10f Talk
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

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
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

Ruby On Yield by 'reference'

by Tj Holowaychuk, October 24, 2008 18:31

Hmm well that makes sense a...

F1e3ab214a976a39cfd713bc93deb10f Talk
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
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