#include <stdio.h>
#include <stdlib.h>

...

C Polymorphic functions using...

by Tj Holowaychuk, April 21, 2009 23:24, 5 refactorings, tagged with pointers polymorphic

The *stupid* example below ...

F1e3ab214a976a39cfd713bc93deb10f Talk
---
--- 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
URL url = new URL("https://dev.psigate.com:7989/Messenger/XMLMessenger");
				HttpURLConnection connection = (HttpURLConnection)url.openConnection();
				connection.setDoInput(true);		
...

Java PSiGate

by danielharan, January 30, 2009 01:46, 4 refactorings, tagged with xml, psigate, cc, webservice

This seems particularly egr...

880cbab435f00197613c9cc2065b4f5a 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
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
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
class ReportReader
  def initialize(file_name)
    @lines = File.open(file_name).read.split("\n")
...

Ruby On Parsing non-delimited text

by danielharan, October 06, 2008 13:54

Separate out parsing logic ...

880cbab435f00197613c9cc2065b4f5a 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
#!/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
module Builder
  
  #
...

Ruby On Interactive CLI Session

by Tj Holowaychuk, September 24, 2008 17:57

I am defiantly not used to ...

F1e3ab214a976a39cfd713bc93deb10f Talk