Bit Dust
I beg your patience, as over the next few weeks I slowly merge my two previous blogs into this one.
You’ll have a close up view as I finish this out.
I beg your patience, as over the next few weeks I slowly merge my two previous blogs into this one.
You’ll have a close up view as I finish this out.
Ruby is a subtle language. If you come to it after mastering another language like Perl or Java, it's easy to write Ruby code that looks a lot like the code you used to write in your previous language. Now, writing code that way won't take any longer than it would've taken in your previous language. But if you decide to become another disciple in the burgeoning Ruby cult, you'll have a lot to gain by absorbing the various Ruby idioms. You'll write clearer code in less time, and you'll write less of it while accomplishing as much as you had beforeA recommended read.
PERL/VBA Programmer Required Experience: Developer with extensive knowledge of PERL and ability to code 7.5K to10K lines per day.Yow. Via the daily wtf. On an unrelated tangent while of ten thousand lines, there is the story of Master Foo and the Ten Thousand Lines. (Why I dislike C.)
#!/usr/local/bin/ruby
# Note: This script requires ruby 1.8
require 'open-uri'
require "rexml/document"
puts
xml = open("http://devsupport/cgi-bin/trac.cgi/report/4?format=rss").read
rss = REXML::Document.new xml
rss.elements.each("//item[author/text()='DanielVonFange']/title") { |element|
task = /(#[0-9]+): (.+)/.match(element.text)
puts "[ ] #{task[2]} - #{task[1]}"
}
Another small script is for my completed todo items. I click on a line, press command-shift-D, and the todo item vanishes from the list, and appears in a log file along with the time that I finished it, and what file it came from.
Log entry:
[X] Blog Textmate converting me to a unix head - Tasks rip, GTD completion.
in Blog 08:48 20041019 Tue
Log script:
#!/usr/bin/ruby
task_text = $stdin.read
task_text.gsub!(/[ ] /,"[X] ")
from = File.basename(ARGV[0],".txt")
File.open("/Users/dvf/Documents/Writing/Life/plan/Completed.txt",'a'){|archive_file|
archive_file.puts
archive_file.puts task_text
archive_file.puts " in #{from} #{`date "+%H:%M %Y%m%d %a"`}"
}
This script must be saved to a file, and then called as command, passing along the name of the current file being edited. So it the command in TextMate would look something like this:
ruby /path/to/script/task_completed.rb $TM_FILEPATHThese are just quick hacks, but I'm slowly learning the way of the scripted editor.
The rich web application toolkit Laszlo just went open source. I’ve wanted to mess with Laszlo for a while, now maybe I can find an excuse.
The Laszlo in ten minutes area allows you to step through the basics of writing Laszlo’s xml file, and get live feedback on your modifications of their tutorial. It’s a great way to get a feel for simple development.
Whoo hoo.
Here is an experiment in displaying a customer's payment history. Each bar is a project. The width of the bar shows the dollar value of a project, the length how many days it took to be payed.
At a glance I can compare how big of a customer they are, and the size of the projects, and how well they pay. Pretty cool.
(I'm using this on my internal project "Dashboard" that I've built)