#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
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
#!/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 CLI
  class Session 
    
...

Ruby Interactive CLI Session

by Tj Holowaychuk, September 23, 2008 16:06, 3 refactorings, tagged with cli shell

Again I am a Ruby newb (two...

F1e3ab214a976a39cfd713bc93deb10f Talk
#
  # Format filesize.
  #
...

Ruby Format Filesize

by Tj Holowaychuk, September 22, 2008 15:40, 3 refactorings, tagged with filesize format

Ruby-newb coming through. I...

F1e3ab214a976a39cfd713bc93deb10f Talk
#
  # Convert a string to CamelCase.
...

Ruby Camelize

by Tj Holowaychuk, September 22, 2008 15:38, 7 refactorings, tagged with camelcase

I am pretty new to Ruby (on...

F1e3ab214a976a39cfd713bc93deb10f Talk
static public function invoke($hook) {
    $packages = array();
    $results = array();  
...

PHP Dynamically invoking static...

by Tj Holowaychuk, June 09, 2008 20:52, 1 refactoring, tagged with class, eval, static

Hey guys, I should have rea...

F1e3ab214a976a39cfd713bc93deb10f Talk
<?php
$std = fopen("php://stdin", "r");
echo "TICTACTOE\n\n\n\n";
...

PHP Command-Line TicTacToe

by techietim, March 24, 2008 00:00, 3 refactorings, tagged with php, game, tictactoe

Just wondering if there are...

441c4f02db55ef2cbe96027af7012e01 Talk

Ruby On Getting QWERTY misstypes

by Marco Valtas, October 24, 2007 02:45

Hi, I don't how to write a ...

0706636fd5e30fa66019d7ffacdb5b11 Talk