“Drop Rails into TomCat and it just works” - Ola Bini on JRuby presentation
Until Ola Bini stood up at the Stockholm Rails/Ruby Group meeting the other night, I had only a passing interest in JRuby.
To me, running Ruby on Java made as much sense as running Java on a JVM on top of another JVM. Virtual machine on a virtual machine… surely that’s already one virtual machine too many?
Then he said something that no Rails person had said before:
You JAR up your rails app, upload it to TomCat and your Rails app is deployed. It just works.
“Upload it … and it just works” - I still don’t think I’ve heard of a technical solution for deploying Rails apps that’s been bold enough to claim this.
Below is the 30 minute presentation by Ola from the other night where he goes into the details, plus more on the status of JRuby, its performance compared to Ruby, and its future.
Summary: there’s a whole lot of wonderful energy within the JRuby Core camp.
Meta-Magic in Ruby: Dr Nic Unplugged in Stockholm
Last nights’ Ruby meeting in Stockholm had a great turn out and starred Ola Bini sharing the latest and greatest about JRuby, and myself giving an overview on the wonders of Meta-Magic in Ruby.
I’ll write a separate post on Ola’s presentation shortly. It was awesome and I videoed it. Hehehe.
Meta-magic in a programming language is as important to programmers as changeable ring tones are to teenagers. Authors of programming languages cannot provide every feature to everyone, so it is so wonderful to be able to add new language features and extensions that you want. Everyone knows you can add Jessica Simpson as your mobile ring tone, but not all programmers know that you can add new features to their programming world.
So here is an overview to a new world of happiness. It also overviews how the Magic Models work, and introduces a new gem I’m working on - the Magic Wiggly Lines - described as “genius or insane”
Syntax Highlighting in Tumblr
I wrote an email to the lovely Tumblr people asking for Syntax Highlighting for code chunks. Several hours passed and they still hadn’t jumped at the chance to appease me with some syntax highlighting.
So I wrote one, and so now all Tumblrers can use it.
See the demo from my tumblr, and in a frame below:
To use this in your own Tumblr (or probably anywhere I guess), do the following:
- Go to settings
- At the bottom, turn off ‘Use rich text editing’ and ‘Filter HTML’, and save settings.
- Go back into settings, and select Custom theme. This will give you the raw html for your previously selected theme
- Just above/before the
</head><body>section, insert these two lines of html
- This gives you support for Ruby, Javascript, CSS and HTML. To activate this for any <pre> or <code> block then merely assign a class of
ruby,javascript,cssorhtmlto a<code>wrapper.
For example, to set Javascript syntax in a <pre> you still need to include a <code> inside:
<pre><code class="javascript">function foo() {
return "Dr Nic";
}
</code></pre>
Can I change the highlighting?
Get the styles.css file, change it, post it somewhere (or give it to me with a new name, and I’ll post it here), and change the <link href="...your dir/styles.css"> above.
Can I support more languages?
Grab the four language files (css, ruby, javascript, and html) and slap one together for module-2 if you like. Again, if you want me to host it here, just ping me. Also, email it to Dan Webb so he can add it to his CodeHighlighter project.
“I’m from Tumblr, we’ve just implemented syntax highlighting”
*blank stare*
Does cygwin have a port equivalent?
So now I have a unix-based laptop (with a glowing piece of fruit on the lid), I have been revisiting saved blog articles about snazzy unix-only short cuts and hacks.
The first one I craved? Auto-complete for rake.
$ wget http://pastie.caboo.se/17743.txt
-bash: wget: command not found
What the? wget isn’t a standard command? Well, let me just fix that right now.
$ sudo port install wget
Password:
—> Fetching wget
—> Attempting to fetch wget-1.10.2.tar.gz from ftp://ftp.gnu.org/gnu/wget
—> etc etc etc til success
port (aka DarwinPorts aka MacPorts) is sweet simple awesomeness.
When fetchin new apps from cygwin I’ve always used the GUI installer. I wonder if it has a command-line equivalent to port?
Perhaps renaming Cygwin’s famous setup.exe to port.exe might sooth the soreness.
Dr Nic’s Tumblelog
Everyday I have 100s of blog articles to read [Ed: mostly I read the title and press the 'N' button], so I’m fearful of dumping random ideas and links into this blog. This blog is for dumping random code chunks and releasing fancy-pancy new projects. Its mostly devoid of opinion.
Solution: a tumblelog
full of random scraps and chunky opinion. By random I mean, things related to Ruby, Rails, Javascript, etc that fit nicely amongst the things we all care about already. Plus pictures of me and my family, because I’m just narcissistic enough to think you might care
