• About
  • Projects
  • Sources
  • Tools

Oliver Steele

Languages of the real and artificial

Home ::

DB Content Rails Plugin

By oliver - Posted on April 18th, 2008
Tagged:  
  • Libraries
  • Ruby

The DB Content Rails plugin adds tasks to save and restore database content.  read more »

Usage

— dump the development database to db/archive/development-content.sql.gz
rake db:content:dump
 
— load the dumped database, and apply any necessary migrations
$ rake db:content:load
 
— dump the production database to db/archive/production-content.sql.gz
$ RAILS_ENV=production rake db:content:dump
 
— save the development database to db/archive/{timestamp}.sql.gz
$ rake db:content:save
 
— save the (compressed) database to my-data.sql.gz
$ rake db:content:save FILE=my-data.sql.gz
  • oliver's blog

JCON: Ruby Gem for JSON type conformance

By oliver - Posted on April 17th, 2008
Tagged:  
  • JavaScript
  • Libraries
  • Ruby

JCON (the JavaScript Conformance gem) tests JSON values against ECMAScript 4.0-style type definitions
(PDF) such as string?, (int, boolean), or [string, (int, boolean), {x:double, y:double}?].

Usage

type = JCON::parse "[string, int]"
type.contains?([‘a’, 1])     # => true
type.contains?([‘a’, ‘b’])   # => false
type.contains?([‘a’, 1, 2])  # => true

JCON also defines an RSpec matcher, conforms_to_js:  read more »

  • oliver's blog

JavaScript Fu Rails Plugin

By oliver - Posted on April 15th, 2008
Tagged:  
  • JavaScript
  • Libraries
  • Ruby

JavaScript Fu extends Rails with a few facilities to better integrate JavaScript into Rails development:

1. The notes and statistics rake tasks compass JavaScript files in the public/javascript directory:

$ rake notes
public/javascripts/controls.js:
  * [782] [TODO] improve sanity check
$ rake stats
| Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |
[...]
| JavaScript           |  7287 |  6322 |       0 |       0 |   0 |     0 |
[...]

2. The call_js RSpec matcher asserts that a string or response contains a script tag, that contains JavaScript that calls the named function or method:  read more »

  • oliver's blog
  • 5 comments

FizzBuzz Station

By oliver - Posted on February 29th, 2008
Tagged:  
  • Amusements
  • Illustrations
  • Ruby

Uh oh! I overthought fizzbuzz:

 read more »

  • oliver's blog
  • 4 comments

reWork: an online workbench for regular expressions

By oliver - Posted on February 24th, 2006
Tagged:  
  • JavaScript
  • Projects
  • Python
  • Ruby

reAnimator got me interested in writing something that would let you use regular expressions. That something is reWork. This web page has a couple of fields where you can type in a regular expression and a string to match it against, and see the results update as you type. It also displays the code to perform the match in some of the languages (JavaScript, PHP, Python, and Ruby) that I use with regular expressions.

reWork limited to the features of the JavaScript regex engine. In particular, it’s missing dotall (/.../s), because JavaScript is. I actually figured out a hack to implement dotall anyway, but this will have to wait for another day.  read more »

  • oliver's blog
  • 1 comment

OpenLaszlo Ruby library

By oliver - Posted on January 5th, 2006
Tagged:  
  • Libraries
  • OpenLaszlo
  • Projects
  • Ruby

openlaszlo.rb is a Ruby library for compiling OpenLaszlo programs. I use it to build this, this, and the toolbar here. This article describes how to use it with Rake.

Update: This is now available as a gem.  read more »

  • oliver's blog

Ruby and Laszlo

By oliver - Posted on March 8th, 2005
Tagged:  
  • OpenLaszlo
  • Programming Languages
  • Ruby

I first heard of Ruby at the second Lightweight Languages Workshop 2, where Matz and I were both speakers. This was first public disclosure of the then-proprietary Laszlo platform language. I’m afraid I was more worried about preparing my talk then listening to Matz at the time!

Since then, a number of different people have expressed interest in both Laszlo and Ruby. I figured I had finally better take a look at it.  read more »

  • oliver's blog
  • 3 comments

Recent

  • Latin Agreement and Case
  • Smiley Socket
  • Commit Policies
  • My Git Workflow
  • Pneumococoa
  • My No TV
  • The Biofuel Economy
  • Ambimation
  • jQuery Profile Plugin
  • The Shadow of a Legacy
more

Categories

  • Amusements (10)
  • Essays (20)
  • Family (8)
  • General (9)
  • Health (1)
  • Illustrations (11)
  • Inventions (2)
  • JavaScript (24)
  • Libraries (21)
  • Math Education (9)
  • OpenLaszlo (31)
  • Programming (7)
  • Programming Languages (6)
  • Projects (23)
  • Python (3)
  • Ruby (7)
  • Software (3)
  • Open Source (4)
  • XML (6)
  • Software Development (8)
  • Systems Thinking (6)
  • Technology (7)
  • Tips (5)
  • Visualizations (13)
  • Words (9)

Navigation

  • Recent posts
  • Tools

Syndicate

Syndicate content

About

Oliver Steele lives in Western Massachusetts and commutes to downtown LA, where he is bringing an operating system from handwaving to reality. He was the architect of OpenLaszlo, the author of PyWordNet and other open source projects. His interests include programming languages, knowledge representation, information visualization, and math education. [more]

Tools

  • reAnimator
  • reWork

Amusements

  • Aargh
  • foldr
  • WideURL.com

Popular

  • Functional JavaScript
  • JavaScript Memoization
  • Overloading Semicolon
  • reAnimator
  • The IDE Divide
  • Visualizing Basic Algebra
Copyright 1995-2008 by Oliver Steele. All rights reserved.